package com.csun.cmny.provider.utils;

import com.csun.cmny.provider.model.vo.device.DmcDeviceAlertLifeRoomVo;
import com.csun.cmny.provider.model.vo.patrol.PatrolRecordVo;
import com.csun.cmny.provider.model.vo.patrol.PatrolReminderVo;
import com.csun.cmny.util.PublicUtil;
import jxl.SheetSettings;
import jxl.Workbook;
import jxl.format.Alignment;
import jxl.format.Colour;
import jxl.format.UnderlineStyle;
import jxl.format.VerticalAlignment;
import jxl.write.*;
import jxl.write.biff.RowsExceededException;
import org.apache.commons.lang3.StringUtils;

import javax.servlet.http.HttpServletResponse;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Map;

/** 
 * jxl导出excel 
 * @author jamboree 
 * @date  2013-11-28 
 */  
public class JxlExcelUtils {  
  
	/**
	 * 导出医院
	 * @param response
	 * @param objData
	 * @param sheetName
	 * @param columns
	 */
	public static void hospitalToExcel(HttpServletResponse response , List<Map<String,Object>> objData,
                                       String sheetName, List<String> columns ){
		
		OutputStream os = null;
		WritableWorkbook workbook = null;
		
		try{
			os = response.getOutputStream();
			workbook=Workbook.createWorkbook(os);
			WritableSheet sheet = workbook.createSheet(sheetName, 0 ); //添加第一个工作表
			
			jxl.write.WritableFont wft = new  jxl.write.WritableFont(WritableFont.ARIAL, 10 ,WritableFont.BOLD, false ,jxl.format.UnderlineStyle.NO_UNDERLINE,jxl.format.Colour.BLACK);   
			jxl.write.WritableCellFormat wcfFT = new jxl.write.WritableCellFormat(wft); 
			wcfFT.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			//wcfFT.setWrap(true);
			jxl.write.WritableFont wfcc = new  jxl.write.WritableFont(WritableFont.ARIAL, 10 ,WritableFont.NO_BOLD, false ,jxl.format.UnderlineStyle.NO_UNDERLINE,jxl.format.Colour.BLACK);   
			jxl.write.WritableCellFormat wfcf = new  jxl.write.WritableCellFormat(wfcc); 
			wfcf.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			wfcf.setWrap(true);
			
			//合并单元格   
			//sheet.mergeCells(int col1,int row1,int col2,int row2);//左上角到右下角   
			sheet.mergeCells(0, 0, 7, 1); //左上角到右下角   
			jxl.write.WritableFont wfc = new  jxl.write.WritableFont(WritableFont.ARIAL, 20 ,WritableFont.BOLD, false ,jxl.format.UnderlineStyle.NO_UNDERLINE,jxl.format.Colour.BLACK);   
			jxl.write.WritableCellFormat wchB = new  jxl.write.WritableCellFormat(wfc);   
			wchB.setAlignment(jxl.format.Alignment.CENTRE);  
			wchB.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			
			jxl.write.Label labelCFC = new  jxl.write.Label( 0 , 0 , "医院信息统计" ,wchB);
			sheet.addCell(labelCFC); 
			
			sheet.setColumnView(1, 30);
			sheet.setColumnView(2, 12);
			sheet.setColumnView(3, 10);
			sheet.setColumnView(4, 10);
			sheet.setColumnView(5, 10);
			sheet.setColumnView(6, 12);
			sheet.setColumnView(7, 25);
			
			//循环写入表头  
            for (int i = 0; i < columns.size(); i++) {  

            	sheet.addCell(new Label(i, 2, columns.get(i), wcfFT));  
            } 
            
            if( objData != null &&  objData.size() > 0){
            	//循环写出数据
            	
            	for(int i = 0; i<objData.size(); i++){
            		
            		//获取医院信息
            		Map<String,Object> hospital = (Map<String,Object>)objData.get(i);
            		
            		//在Excel列里面写出医院的信息
            		
            		sheet.addCell(new Label(0,i+3,String.valueOf(i+1),wfcf));//序号
            		sheet.addCell(new Label(1,i+3,String.valueOf(hospital.get("hospitalname")),wfcf)); //医院名称
            		String hosType =String.valueOf(hospital.get("type")).trim();   //获取医院的类型
            		if(StringUtils.isBlank(hosType)){
            			hosType = "/";
            		}else{
            			if("1".equals(hosType)){
                			hosType = "初筛";
                		}else if("2".equals(hosType)){
                			hosType = "复筛";
                		}else if("3".endsWith(hosType)){
                			hosType = "初、复筛";
                		}else{
                			hosType = "/";
                		}
            		}
            		sheet.addCell(new Label(2,i+3,hosType,wfcf));           //医院类型
            		
            		sheet.addCell(new Label(3,i+3,String.valueOf(hospital.get("provincename")),wfcf));           //省份
            		sheet.addCell(new Label(4,i+3,String.valueOf(hospital.get("cityname")),wfcf));           //市名
            		sheet.addCell(new Label(5,i+3,String.valueOf(hospital.get("areaName")),wfcf));           //区域
            		String salesman = String.valueOf(hospital.get("realname"));    //客服专员
            		//System.out.println("业务员"+ salesman);
            		if(StringUtils.isBlank(salesman)||salesman.equals("null")){
            			salesman = "/";
            		}
            		sheet.addCell(new Label(6,i+3,salesman,wfcf));           //客服专员
            		sheet.addCell(new Label(7,i+3,String.valueOf(hospital.get("createTime")),wfcf));           //创建时间
	
            	}
                    
            	//写入Exel工作表  
                workbook.write();  
            	
            }
            
            //关闭Excel工作薄对象   
            workbook.close();  
              
            //关闭流  
            os.flush();  
            os.close();  
              
            os =null; 
            
		}catch(Exception e){
			e.printStackTrace();
		}
		
		
	}
	
	public static void patientToExcel(HttpServletResponse response, List<Map<String, Object>> objData, String sheetName, List<String> columns,
                                      boolean isShow, boolean isManager) {
		
		WritableWorkbook workbook;
		try {
			OutputStream os = response.getOutputStream();
			workbook=Workbook.createWorkbook(os);
			
			WritableSheet sheet = workbook.createSheet(sheetName, 0 );  //添加第一个工作表
			
			jxl.write.WritableFont wft = new  jxl.write.WritableFont(WritableFont.ARIAL, 10 ,WritableFont.BOLD, false ,jxl.format.UnderlineStyle.NO_UNDERLINE,jxl.format.Colour.BLACK);   
			jxl.write.WritableCellFormat wcfFT = new jxl.write.WritableCellFormat(wft); 
			wcfFT.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			//wcfFT.setWrap(true);
			jxl.write.WritableFont wfcc = new  jxl.write.WritableFont(WritableFont.ARIAL, 10 ,WritableFont.NO_BOLD, false ,jxl.format.UnderlineStyle.NO_UNDERLINE,jxl.format.Colour.BLACK);   
			jxl.write.WritableCellFormat wfcf = new  jxl.write.WritableCellFormat(wfcc); 
			wfcf.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			wfcf.setWrap(true);
			
			//合并单元格   
			//sheet.mergeCells(int col1,int row1,int col2,int row2);//左上角到右下角   
			sheet.mergeCells(0, 0, 19, 1); //左上角到右下角   
			jxl.write.WritableFont wfc = new  jxl.write.WritableFont(WritableFont.ARIAL, 20 ,WritableFont.BOLD, false ,jxl.format.UnderlineStyle.NO_UNDERLINE,jxl.format.Colour.BLACK);   
			jxl.write.WritableCellFormat wchB = new  jxl.write.WritableCellFormat(wfc);   
			wchB.setAlignment(jxl.format.Alignment.CENTRE);  
			wchB.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			
			jxl.write.Label labelCFC = new  jxl.write.Label( 0 , 0 , "患者信息统计" ,wchB);   
			sheet.addCell(labelCFC); //
			sheet.setColumnView(2, 12);
			sheet.setColumnView(3, 12);
			sheet.setColumnView(6, 12);
			sheet.setColumnView(8, 25);
			sheet.setColumnView(9, 12);
			sheet.setColumnView(10, 12);
			if (isManager) {
				sheet.setColumnView(10, 0);
			}
			sheet.setColumnView(11, 20);
			sheet.setColumnView(12, 12);
			sheet.setColumnView(14, 15);
			sheet.setColumnView(15, 15);
			sheet.setColumnView(16, 12);
			sheet.setColumnView(17, 12);
			sheet.setColumnView(18, 12);
			sheet.setColumnView(19, 12);
//			jxl.write.Label label;  
//			for  ( int  i= 0 ; i<title.length; i++)  
//			{  
//				//Label(列号,行号 ,内容 )   
//				label = new  jxl.write.Label(i,  2, title[i], wcfFT);  //put the title in row1    
//				sheet.addCell(label);   
//			}	  
			
			//循环写入表头  
            for (int i = 0; i < columns.size(); i++) {  

                /* 
                 * 添加单元格(Cell)内容addCell() 
                 * 添加Label对象Label() 
                 * 数据的类型有很多种、在这里你需要什么类型就导入什么类型 
                 * 如：jxl.write.DateTime 、jxl.write.Number、jxl.write.Label 
                 * Label(i, 0, columns[i], wcf) 
                 * 其中i为列、0为行、columns[i]为数据、wcf为样式 
                 * 合起来就是说将columns[i]添加到第一行(行、列下标都是从0开始)第i列、样式为什么"色"内容居中 
                 */  
            	sheet.addCell(new Label(i, 2, columns.get(i), wcfFT));  
            } 
			
			//判断表中是否有数据  
            if (objData != null && objData.size() > 0) {  
                //循环写入表中数据  
                for (int i = 0; i < objData.size(); i++) {  

                    //转换成map集合{activyName:测试功能,count:2}  
                    Map<String, Object> map = (Map<String, Object>)objData.get(i);  

                    //循环输出map中的子集：既列值  
                    sheet.addCell(new Label(0, i + 3, String.valueOf(i+1), wfcf));
                    String patientName = String.valueOf(map.get("patientName"));
                    if (patientName == null || patientName.equals("null") || patientName.equals("")) {
                    	patientName = "/";
                    }
                    sheet.addCell(new Label(1, i + 3, patientName, wfcf));
                    sheet.addCell(new Label(2, i + 3, String.valueOf(map.get("birthday")), wfcf));
//                    sheet.addCell(new Label(3, i + 3, String.valueOf(map.get("ageMonth")), wfcf));
                    sheet.addCell(new Label(3, i + 3, String.valueOf(map.get("firstAge")), wfcf));
                    if (String.valueOf(map.get("sex")).equals("0")) {
                    	//System.out.println("男");
                    	sheet.addCell(new Label(4, i + 3, "男", wfcf));
                    } else {
                    	//System.out.println("女");
                    	sheet.addCell(new Label(4, i + 3, "女", wfcf));
                    }
                    //sheet.addCell(new Label(3, i + 3, String.valueOf(map.get("sex")), wfcf));
                    sheet.addCell(new Label(5, i + 3, String.valueOf(map.get("areaName")), wfcf));
                    sheet.addCell(new Label(6, i + 3, String.valueOf(map.get("entity")), wfcf));
                    sheet.addCell(new Label(7, i + 3, String.valueOf(map.get("part")), wfcf));
                    sheet.addCell(new Label(8, i + 3, String.valueOf(map.get("first_desc")), wfcf));
                    sheet.addCell(new Label(9, i + 3, String.valueOf(map.get("hospital")), wfcf));
                    String fchospital = String.valueOf(map.get("fchospital"));
                    if (fchospital == null || fchospital.equals("null") || fchospital.equals("")) {
                    	fchospital = "/";
                    }
                    if (isManager) {
                    	sheet.addCell(new Label(10, i + 3, "*****", wfcf));
                    } else {
                    	sheet.addCell(new Label(10, i + 3, fchospital, wfcf));
                    }
                    sheet.addCell(new Label(11, i + 3, String.valueOf(map.get("createTime")), wfcf));
                    String phone2 = String.valueOf(map.get("phone"));
                    if (isShow) {
                    	sheet.addCell(new Label(12, i + 3, String.valueOf(map.get("fatherPhone")), wfcf));
                    } else {
                    	if (phone2.length() > 7) {
                    		sheet.addCell(new Label(12, i + 3, phone2.substring(0,4) + "***" + phone2.substring(7, phone2.length()), wfcf));
        				} else {
        					sheet.addCell(new Label(12, i + 3, String.valueOf(map.get("phone")), wfcf));
        				}
                    }
                    if (String.valueOf(map.get("pic")).equals("0")) {
                    	sheet.addCell(new Label(13, i + 3, "/", wfcf));
                    } else {
                    	sheet.addCell(new Label(13, i + 3, "有", wfcf));
                    }
                    sheet.addCell(new Label(14, i + 3, String.valueOf(map.get("doctorName")), wfcf));
                    String phone3 = String.valueOf(map.get("mobilePhone"));
                    if (isShow) {
                    	sheet.addCell(new Label(15, i + 3, String.valueOf(map.get("mobilePhone")), wfcf));
                    } else {
                    	if (phone3.length() > 7) {
                    		sheet.addCell(new Label(15, i + 3, phone3.substring(0,4) + "***" + phone3.substring(7, phone3.length()), wfcf));
        				} else {
        					sheet.addCell(new Label(15, i + 3, String.valueOf(map.get("mobilePhone")), wfcf));
        				}
                    }
                    String entity_type = String.valueOf(map.get("entity_type"));
                    if (entity_type == null || entity_type.equals("null") || entity_type.equals("")) {
                    	entity_type = "/";
                    }
                    sheet.addCell(new Label(16, i + 3, entity_type, wfcf));
                    String isfcheck = String.valueOf(map.get("isfcheck"));
                    if (isfcheck == null || isfcheck.equals("null") || isfcheck.equals("")) {
                    	isfcheck = "/";
                    }
                    sheet.addCell(new Label(17, i + 3, isfcheck, wfcf));
                    String cure_type = String.valueOf(map.get("cure_type"));
                    if (cure_type == null || cure_type.equals("null") || cure_type.equals("")) {
                    	cure_type = "/";
                    }
                    sheet.addCell(new Label(18, i + 3, cure_type, wfcf));
                    sheet.addCell(new Label(19, i + 3, String.valueOf(map.get("loginCount")), wfcf));
//                    for(Object o:map.keySet()){  
//                        //ps：因为要“”通用”“导出功能，所以这里循环的时候不是get("Name"),而是通过map.get(o)  
//                    	sheet.addCell(new Label(j,i+3,String.valueOf(map.get(o)), wfcf));  
//                        j++;  
//                    }  
                }
                
              //写入Exel工作表  
                workbook.write();  
  
                //关闭Excel工作薄对象   
                workbook.close();  
                  
                //关闭流  
                os.flush();  
                os.close();  
                  
                os =null; 
            }else{  
            	System.out.println("没有数据.");
            	//写入Exel工作表  
                workbook.write();  
  
                //关闭Excel工作薄对象   
                workbook.close();  
                  
                //关闭流  
                os.flush();  
                os.close();  
                  
                os =null;
                //flag = -1;  
            }
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
	
	public static void mpatientToExcel(HttpServletResponse response, List<Map<String, Object>> objData, String sheetName, List<String> columns,
                                       boolean isShow, boolean isManager) {
		
		WritableWorkbook workbook;
		try {
			OutputStream os = response.getOutputStream();
			workbook=Workbook.createWorkbook(os);
			
			WritableSheet sheet = workbook.createSheet(sheetName, 0 );  //添加第一个工作表
			
			jxl.write.WritableFont wft = new  jxl.write.WritableFont(WritableFont.ARIAL, 10 ,WritableFont.BOLD, false ,jxl.format.UnderlineStyle.NO_UNDERLINE,jxl.format.Colour.BLACK);   
			jxl.write.WritableCellFormat wcfFT = new jxl.write.WritableCellFormat(wft); 
			wcfFT.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			//wcfFT.setWrap(true);
			jxl.write.WritableFont wfcc = new  jxl.write.WritableFont(WritableFont.ARIAL, 10 ,WritableFont.NO_BOLD, false ,jxl.format.UnderlineStyle.NO_UNDERLINE,jxl.format.Colour.BLACK);   
			jxl.write.WritableCellFormat wfcf = new  jxl.write.WritableCellFormat(wfcc); 
			wfcf.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			wfcf.setWrap(true);
			
			//合并单元格   
			//sheet.mergeCells(int col1,int row1,int col2,int row2);//左上角到右下角   
			sheet.mergeCells(0, 0, 17, 1); //左上角到右下角   
			jxl.write.WritableFont wfc = new  jxl.write.WritableFont(WritableFont.ARIAL, 20 ,WritableFont.BOLD, false ,jxl.format.UnderlineStyle.NO_UNDERLINE,jxl.format.Colour.BLACK);   
			jxl.write.WritableCellFormat wchB = new  jxl.write.WritableCellFormat(wfc);   
			wchB.setAlignment(jxl.format.Alignment.CENTRE);  
			wchB.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			
			jxl.write.Label labelCFC = new  jxl.write.Label( 0 , 0 , "患者信息统计" ,wchB);   
			sheet.addCell(labelCFC); //
			sheet.setColumnView(2, 12);
			sheet.setColumnView(3, 12);
			sheet.setColumnView(6, 12);
			sheet.setColumnView(8, 25);
			sheet.setColumnView(9, 15);
			/*
			sheet.setColumnView(9, 12);
			if (isManager) {
				sheet.setColumnView(9, 0);
			}
			*/
			sheet.setColumnView(10, 20);
			sheet.setColumnView(11, 12);
			sheet.setColumnView(13, 15);
			sheet.setColumnView(14, 15);
			sheet.setColumnView(15, 15);
			sheet.setColumnView(16, 15);
			sheet.setColumnView(17, 15);
//			jxl.write.Label label;  
//			for  ( int  i= 0 ; i<title.length; i++)  
//			{  
//				//Label(列号,行号 ,内容 )   
//				label = new  jxl.write.Label(i,  2, title[i], wcfFT);  //put the title in row1    
//				sheet.addCell(label);   
//			}	  
			
			//循环写入表头  
            for (int i = 0; i < columns.size(); i++) {  

                /* 
                 * 添加单元格(Cell)内容addCell() 
                 * 添加Label对象Label() 
                 * 数据的类型有很多种、在这里你需要什么类型就导入什么类型 
                 * 如：jxl.write.DateTime 、jxl.write.Number、jxl.write.Label 
                 * Label(i, 0, columns[i], wcf) 
                 * 其中i为列、0为行、columns[i]为数据、wcf为样式 
                 * 合起来就是说将columns[i]添加到第一行(行、列下标都是从0开始)第i列、样式为什么"色"内容居中 
                 */  
            	sheet.addCell(new Label(i, 2, columns.get(i), wcfFT));  
            } 
			
			//判断表中是否有数据  
            if (objData != null && objData.size() > 0) {  
                //循环写入表中数据  
                for (int i = 0; i < objData.size(); i++) {  

                    //转换成map集合{activyName:测试功能,count:2}  
                    Map<String, Object> map = (Map<String, Object>)objData.get(i);  

                    //循环输出map中的子集：既列值  
                    sheet.addCell(new Label(0, i + 3, String.valueOf(i+1), wfcf));
                    String patientName = String.valueOf(map.get("patientName"));
                    if (patientName == null || patientName.equals("null") || patientName.equals("")) {
                    	patientName = "/";
                    }
                    sheet.addCell(new Label(1, i + 3, patientName, wfcf));
                    sheet.addCell(new Label(2, i + 3, String.valueOf(map.get("birthday")), wfcf));
                    //sheet.addCell(new Label(3, i + 3, String.valueOf(map.get("ageMonth")), wfcf));
                    sheet.addCell(new Label(3, i + 3, String.valueOf(map.get("firstAge")), wfcf));
                    if (String.valueOf(map.get("sex")).equals("0")) {
                    	//System.out.println("男");
                    	sheet.addCell(new Label(4, i + 3, "男", wfcf));
                    } else {
                    	//System.out.println("女");
                    	sheet.addCell(new Label(4, i + 3, "女", wfcf));
                    }
                    //sheet.addCell(new Label(3, i + 3, String.valueOf(map.get("sex")), wfcf));
                    sheet.addCell(new Label(5, i + 3, String.valueOf(map.get("areaName")), wfcf));
                    sheet.addCell(new Label(6, i + 3, String.valueOf(map.get("entity")), wfcf));
                    sheet.addCell(new Label(7, i + 3, String.valueOf(map.get("part")), wfcf));
                    sheet.addCell(new Label(8, i + 3, String.valueOf(map.get("first_desc")), wfcf));
                    sheet.addCell(new Label(9, i + 3, String.valueOf(map.get("hospital")), wfcf));
                    String fchospital = String.valueOf(map.get("fchospital"));
                    if (fchospital == null || fchospital.equals("null") || fchospital.equals("")) {
                    	fchospital = "/";
                    }
                    /*
                    if (isManager) {
                    	sheet.addCell(new Label(9, i + 3, "*****", wfcf));
                    } else {
                    	sheet.addCell(new Label(9, i + 3, fchospital, wfcf));
                    }
                    */
                    sheet.addCell(new Label(10, i + 3, String.valueOf(map.get("createTime")), wfcf));
                    String phone2 = String.valueOf(map.get("phone"));
                    if (isShow) {
                    	sheet.addCell(new Label(11, i + 3, String.valueOf(map.get("fatherPhone")), wfcf));
                    } else {
                    	if (phone2.length() > 7) {
                    		sheet.addCell(new Label(11, i + 3, phone2.substring(0,4) + "***" + phone2.substring(7, phone2.length()), wfcf));
        				} else {
        					sheet.addCell(new Label(11, i + 3, String.valueOf(map.get("phone")), wfcf));
        				}
                    }
                    if (String.valueOf(map.get("pic")).equals("0")) {
                    	sheet.addCell(new Label(12, i + 3, "/", wfcf));
                    } else {
                    	sheet.addCell(new Label(12, i + 3, "有", wfcf));
                    }
//                    for(Object o:map.keySet()){  
//                        //ps：因为要“”通用”“导出功能，所以这里循环的时候不是get("Name"),而是通过map.get(o)  
//                    	sheet.addCell(new Label(j,i+3,String.valueOf(map.get(o)), wfcf));  
//                        j++;  
//                    }
                    sheet.addCell(new Label(13, i + 3, String.valueOf(map.get("doctorName")), wfcf));
                    String entity_type = String.valueOf(map.get("entity_type"));
                    if (entity_type == null || entity_type.equals("null") || entity_type.equals("")) {
                    	entity_type = "/";
                    }
                    sheet.addCell(new Label(14, i + 3, entity_type, wfcf));
                    String isfcheck = String.valueOf(map.get("isfcheck"));
                    if (isfcheck == null || isfcheck.equals("null") || isfcheck.equals("")) {
                    	isfcheck = "/";
                    }
                    sheet.addCell(new Label(15, i + 3, isfcheck, wfcf));
                    String cure_type = String.valueOf(map.get("cure_type"));
                    if (cure_type == null || cure_type.equals("null") || cure_type.equals("")) {
                    	cure_type = "/";
                    }
                    sheet.addCell(new Label(16, i + 3, cure_type, wfcf));
                    sheet.addCell(new Label(17, i + 3, String.valueOf(map.get("loginCount")), wfcf));
                    //System.out.println("111111111111111111111111111");
                    /*
                    String phone3 = String.valueOf(map.get("mobilePhone"));
                    if (isShow) {
                    	sheet.addCell(new Label(13, i + 3, String.valueOf(map.get("mobilePhone")), wfcf));
                    } else {
                    	if (phone3.length() > 7) {
                    		sheet.addCell(new Label(13, i + 3, phone3.substring(0,4) + "***" + phone3.substring(7, phone3.length()), wfcf));
        				} else {
        					sheet.addCell(new Label(13, i + 3, String.valueOf(map.get("mobilePhone")), wfcf));
        				}
                    }
                    String entity_type = String.valueOf(map.get("entity_type"));
                    if (entity_type == null || entity_type.equals("null") || entity_type.equals("")) {
                    	entity_type = "/";
                    }
                    sheet.addCell(new Label(14, i + 3, entity_type, wfcf));
                    String cure_type = String.valueOf(map.get("cure_type"));
                    if (cure_type == null || cure_type.equals("null") || cure_type.equals("")) {
                    	cure_type = "/";
                    }
                    sheet.addCell(new Label(15, i + 3, cure_type, wfcf));
                    */
                }
                
              //写入Exel工作表  
                workbook.write();  
  
                //关闭Excel工作薄对象   
                workbook.close();  
                  
                //关闭流  
                os.flush();  
                os.close();  
                  
                os =null; 
            }else{  
            	System.out.println("没有数据.");
            	//写入Exel工作表  
                workbook.write();  
  
                //关闭Excel工作薄对象   
                workbook.close();  
                  
                //关闭流  
                os.flush();  
                os.close();  
                  
                os =null;
                //flag = -1;  
            }
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
	
	public static void spatientToExcel(HttpServletResponse response, List<Map<String, Object>> objData, String sheetName, List<String> columns,
                                       boolean isShow, boolean isManager) {
		
		WritableWorkbook workbook;
		try {
			OutputStream os = response.getOutputStream();
			workbook=Workbook.createWorkbook(os);
			
			WritableSheet sheet = workbook.createSheet(sheetName, 0 );  //添加第一个工作表
			
			jxl.write.WritableFont wft = new  jxl.write.WritableFont(WritableFont.ARIAL, 10 ,WritableFont.BOLD, false ,jxl.format.UnderlineStyle.NO_UNDERLINE,jxl.format.Colour.BLACK);   
			jxl.write.WritableCellFormat wcfFT = new jxl.write.WritableCellFormat(wft); 
			wcfFT.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			//wcfFT.setWrap(true);
			jxl.write.WritableFont wfcc = new  jxl.write.WritableFont(WritableFont.ARIAL, 10 ,WritableFont.NO_BOLD, false ,jxl.format.UnderlineStyle.NO_UNDERLINE,jxl.format.Colour.BLACK);   
			jxl.write.WritableCellFormat wfcf = new  jxl.write.WritableCellFormat(wfcc); 
			wfcf.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			wfcf.setWrap(true);
			
			//合并单元格   
			//sheet.mergeCells(int col1,int row1,int col2,int row2);//左上角到右下角   
			sheet.mergeCells(0, 0, 18, 1); //左上角到右下角   
			jxl.write.WritableFont wfc = new  jxl.write.WritableFont(WritableFont.ARIAL, 20 ,WritableFont.BOLD, false ,jxl.format.UnderlineStyle.NO_UNDERLINE,jxl.format.Colour.BLACK);   
			jxl.write.WritableCellFormat wchB = new  jxl.write.WritableCellFormat(wfc);   
			wchB.setAlignment(jxl.format.Alignment.CENTRE);  
			wchB.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			
			jxl.write.Label labelCFC = new  jxl.write.Label( 0 , 0 , "患者信息统计" ,wchB);   
			sheet.addCell(labelCFC); //
			sheet.setColumnView(2, 12);
			sheet.setColumnView(3, 12);
			sheet.setColumnView(6, 12);
			sheet.setColumnView(8, 25);
			sheet.setColumnView(9, 12);
			sheet.setColumnView(10, 12);
			if (isManager) {
				sheet.setColumnView(10, 0);
			}
			sheet.setColumnView(11, 20);
			sheet.setColumnView(12, 12);
			sheet.setColumnView(14, 15);
			sheet.setColumnView(15, 15);
			sheet.setColumnView(16, 15);
			sheet.setColumnView(17, 15);
			sheet.setColumnView(18, 15);
//			jxl.write.Label label;  
//			for  ( int  i= 0 ; i<title.length; i++)  
//			{  
//				//Label(列号,行号 ,内容 )   
//				label = new  jxl.write.Label(i,  2, title[i], wcfFT);  //put the title in row1    
//				sheet.addCell(label);   
//			}	  
			
			//循环写入表头  
            for (int i = 0; i < columns.size(); i++) {  

                /* 
                 * 添加单元格(Cell)内容addCell() 
                 * 添加Label对象Label() 
                 * 数据的类型有很多种、在这里你需要什么类型就导入什么类型 
                 * 如：jxl.write.DateTime 、jxl.write.Number、jxl.write.Label 
                 * Label(i, 0, columns[i], wcf) 
                 * 其中i为列、0为行、columns[i]为数据、wcf为样式 
                 * 合起来就是说将columns[i]添加到第一行(行、列下标都是从0开始)第i列、样式为什么"色"内容居中 
                 */  
            	sheet.addCell(new Label(i, 2, columns.get(i), wcfFT));  
            } 
			
			//判断表中是否有数据  
            if (objData != null && objData.size() > 0) {  
                //循环写入表中数据  
                for (int i = 0; i < objData.size(); i++) {  

                    //转换成map集合{activyName:测试功能,count:2}  
                    Map<String, Object> map = (Map<String, Object>)objData.get(i);  

                    //循环输出map中的子集：既列值  
                    sheet.addCell(new Label(0, i + 3, String.valueOf(i+1), wfcf));
                    String patientName = String.valueOf(map.get("patientName"));
                    if (patientName == null || patientName.equals("null") || patientName.equals("")) {
                    	patientName = "/";
                    }
                    sheet.addCell(new Label(1, i + 3, patientName, wfcf));
                    sheet.addCell(new Label(2, i + 3, String.valueOf(map.get("birthday")), wfcf));
//                    sheet.addCell(new Label(3, i + 3, String.valueOf(map.get("ageMonth")), wfcf));
                    sheet.addCell(new Label(3, i + 3, String.valueOf(map.get("firstAge")), wfcf));
                    if (String.valueOf(map.get("sex")).equals("0")) {
                    	//System.out.println("男");
                    	sheet.addCell(new Label(4, i + 3, "男", wfcf));
                    } else {
                    	//System.out.println("女");
                    	sheet.addCell(new Label(4, i + 3, "女", wfcf));
                    }
                    //sheet.addCell(new Label(3, i + 3, String.valueOf(map.get("sex")), wfcf));
                    sheet.addCell(new Label(5, i + 3, String.valueOf(map.get("areaName")), wfcf));
                    sheet.addCell(new Label(6, i + 3, String.valueOf(map.get("entity")), wfcf));
                    sheet.addCell(new Label(7, i + 3, String.valueOf(map.get("part")), wfcf));
                    sheet.addCell(new Label(8, i + 3, String.valueOf(map.get("first_desc")), wfcf));
                    sheet.addCell(new Label(9, i + 3, String.valueOf(map.get("hospital")), wfcf));
                    String fchospital = String.valueOf(map.get("fchospital"));
                    if (fchospital == null || fchospital.equals("null") || fchospital.equals("")) {
                    	fchospital = "/";
                    }
                    if (isManager) {
                    	sheet.addCell(new Label(10, i + 3, "*****", wfcf));
                    } else {
                    	sheet.addCell(new Label(10, i + 3, fchospital, wfcf));
                    }
                    sheet.addCell(new Label(11, i + 3, String.valueOf(map.get("createTime")), wfcf));
                    String phone2 = String.valueOf(map.get("phone"));
                    if (isShow) {
                    	sheet.addCell(new Label(12, i + 3, String.valueOf(map.get("fatherPhone")), wfcf));
                    } else {
                    	if (phone2.length() > 7) {
                    		sheet.addCell(new Label(12, i + 3, phone2.substring(0,4) + "***" + phone2.substring(7, phone2.length()), wfcf));
        				} else {
        					sheet.addCell(new Label(12, i + 3, String.valueOf(map.get("phone")), wfcf));
        				}
                    }
                    if (String.valueOf(map.get("pic")).equals("0")) {
                    	sheet.addCell(new Label(13, i + 3, "/", wfcf));
                    } else {
                    	sheet.addCell(new Label(13, i + 3, "有", wfcf));
                    }
                    sheet.addCell(new Label(14, i + 3, String.valueOf(map.get("doctorName")), wfcf));
                    
                    String entity_type = String.valueOf(map.get("entity_type"));
                    if (entity_type == null || entity_type.equals("null") || entity_type.equals("")) {
                    	entity_type = "/";
                    }
                    sheet.addCell(new Label(15, i + 3, entity_type, wfcf));
                    String isfcheck = String.valueOf(map.get("isfcheck"));
                    if (isfcheck == null || isfcheck.equals("null") || isfcheck.equals("")) {
                    	isfcheck = "/";
                    }
                    sheet.addCell(new Label(16, i + 3, isfcheck, wfcf));
                    String cure_type = String.valueOf(map.get("cure_type"));
                    if (cure_type == null || cure_type.equals("null") || cure_type.equals("")) {
                    	cure_type = "/";
                    }
                    sheet.addCell(new Label(17, i + 3, cure_type, wfcf));
                    sheet.addCell(new Label(18, i + 3, String.valueOf(map.get("loginCount")), wfcf));
                    /*
                    String phone3 = String.valueOf(map.get("mobilePhone"));
                    if (isShow) {
                    	sheet.addCell(new Label(14, i + 3, String.valueOf(map.get("mobilePhone")), wfcf));
                    } else {
                    	if (phone3.length() > 7) {
                    		sheet.addCell(new Label(14, i + 3, phone3.substring(0,4) + "***" + phone3.substring(7, phone3.length()), wfcf));
        				} else {
        					sheet.addCell(new Label(14, i + 3, String.valueOf(map.get("mobilePhone")), wfcf));
        				}
                    }
                    String entity_type = String.valueOf(map.get("entity_type"));
                    if (entity_type == null || entity_type.equals("null") || entity_type.equals("")) {
                    	entity_type = "/";
                    }
                    sheet.addCell(new Label(15, i + 3, entity_type, wfcf));
                    String cure_type = String.valueOf(map.get("cure_type"));
                    if (cure_type == null || cure_type.equals("null") || cure_type.equals("")) {
                    	cure_type = "/";
                    }
                    sheet.addCell(new Label(16, i + 3, cure_type, wfcf));
                    */
//                    for(Object o:map.keySet()){  
//                        //ps：因为要“”通用”“导出功能，所以这里循环的时候不是get("Name"),而是通过map.get(o)  
//                    	sheet.addCell(new Label(j,i+3,String.valueOf(map.get(o)), wfcf));  
//                        j++;  
//                    }  
                }
                
              //写入Exel工作表  
                workbook.write();  
  
                //关闭Excel工作薄对象   
                workbook.close();  
                  
                //关闭流  
                os.flush();  
                os.close();  
                  
                os =null; 
            }else{  
            	System.out.println("没有数据.");
            	//写入Exel工作表  
                workbook.write();  
  
                //关闭Excel工作薄对象   
                workbook.close();  
                  
                //关闭流  
                os.flush();  
                os.close();  
                  
                os =null;
                //flag = -1;  
            }
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
	
    public static void exportPatientToExcel(String path, List<Map<String, Object>> objData) {
		String targetfile = path ; //输出的excel文件名   
		String worksheet = "患者信息" ; //输出的excel文件工作表名   
		String[] title = {"序号" , "患者姓名" , "年龄", "性别", "地域", "病种", "初筛医院", "复筛医院", "录入时间", "联系方式" }; //excel工作表的标题   
		
		WritableWorkbook workbook;
		
		try {
			
			//创建可写入的Excel工作薄,运行生成的文件在tomcat/bin下   
			//workbook = Workbook.createWorkbook(new File("output.xls"));    
			System.out.println("begin" );  
			  
			OutputStream os=new  FileOutputStream(targetfile);   
			workbook=Workbook.createWorkbook(os);   
			  
			WritableSheet sheet = workbook.createSheet(worksheet, 0 );  //添加第一个工作表   
			//WritableSheet sheet1 = workbook.createSheet("MySheet1", 1); //可添加第二个工作   
			/*  
			jxl.write.Label label = new jxl.write.Label(0, 2, "A label record"); //put a label in cell A3, Label(column,row)  
			sheet.addCell(label);   
			*/   
			
			//添加带有字体颜色,带背景颜色 Formatting的对象    
			jxl.write.WritableFont wft = new  jxl.write.WritableFont(WritableFont.ARIAL, 10 ,WritableFont.BOLD, false ,jxl.format.UnderlineStyle.NO_UNDERLINE,jxl.format.Colour.BLACK);   
			jxl.write.WritableCellFormat wcfFT = new  jxl.write.WritableCellFormat(wft); 
			wcfFT.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			wcfFT.setAlignment(Alignment.CENTRE);
			
			jxl.write.WritableFont wfcc = new  jxl.write.WritableFont(WritableFont.ARIAL, 10 ,WritableFont.NO_BOLD, false ,jxl.format.UnderlineStyle.NO_UNDERLINE,jxl.format.Colour.BLACK);   
			jxl.write.WritableCellFormat wfcf = new  jxl.write.WritableCellFormat(wfcc); 
			wfcf.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			wfcf.setAlignment(Alignment.CENTRE);
			//wcfFC.setBackground(jxl.format.Colour.BLUE);  
			//jxl.write.Label labelCFC = new  jxl.write.Label( 1 , 5 , "带颜色" ,wcfFC);   
			//sheet.addCell(labelCFC); 
			
			//合并单元格   
			//sheet.mergeCells(int col1,int row1,int col2,int row2);//左上角到右下角   
			sheet.mergeCells(0, 0, 9, 1); //左上角到右下角   
			jxl.write.WritableFont wfc = new  jxl.write.WritableFont(WritableFont.ARIAL, 20 ,WritableFont.BOLD, false ,jxl.format.UnderlineStyle.NO_UNDERLINE,jxl.format.Colour.BLACK);   
			jxl.write.WritableCellFormat wchB = new  jxl.write.WritableCellFormat(wfc);   
			wchB.setAlignment(jxl.format.Alignment.CENTRE);  
			wchB.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			jxl.write.Label labelCFC = new  jxl.write.Label( 0 , 0 , "患者信息统计" ,wchB);   
			sheet.addCell(labelCFC); // 
			
			jxl.write.Label label;  
			for  ( int  i= 0 ; i<title.length; i++)  
			{  
				//Label(列号,行号 ,内容 )   
				label = new  jxl.write.Label(i,  2, title[i], wcfFT);  //put the title in row1    
				sheet.addCell(label);   
			}	  
			
			//判断表中是否有数据  
            if (objData != null && objData.size() > 0) {  
                //循环写入表中数据  
                for (int i = 0; i < objData.size(); i++) {  

                    //转换成map集合{activyName:测试功能,count:2}  
                    Map<String, Object> map = (Map<String, Object>)objData.get(i);  

                    //循环输出map中的子集：既列值  
                    sheet.addCell(new Label(0, i + 3, String.valueOf(map.get("id")), wfcf));
                    sheet.addCell(new Label(1, i + 3, String.valueOf(map.get("patientName")), wfcf));
                    sheet.addCell(new Label(2, i + 3, String.valueOf(map.get("age")), wfcf));
                    //sheet.addCell(new Label(3, i + 3, String.valueOf(map.get("sex")), wfcf));
                    System.out.println("'" + String.valueOf(map.get("sex")) + "'");
                    if (String.valueOf(map.get("sex")).equals("0")) {
                    	//System.out.println("男");
                    	sheet.addCell(new Label(3, i + 3, "男", wfcf));
                    } else {
                    	//System.out.println("女");
                    	sheet.addCell(new Label(3, i + 3, "女", wfcf));
                    }
                    sheet.addCell(new Label(4, i + 3, String.valueOf(map.get("areaName")), wfcf));
                    sheet.addCell(new Label(5, i + 3, String.valueOf(map.get("first_desc")), wfcf));
                    sheet.addCell(new Label(6, i + 3, String.valueOf(map.get("hospital")), wfcf));
                    sheet.addCell(new Label(7, i + 3, String.valueOf(map.get("fchospital")), wfcf));
                    sheet.addCell(new Label(8, i + 3, String.valueOf(map.get("createTime")), wfcf));
                    sheet.addCell(new Label(9, i + 3, String.valueOf(map.get("phone")), wfcf));
//                    for(Object o:map.keySet()){  
//                        //ps：因为要“”通用”“导出功能，所以这里循环的时候不是get("Name"),而是通过map.get(o)  
//                    	sheet.addCell(new Label(j,i+3,String.valueOf(map.get(o)), wfcf));  
//                        j++;  
//                    }  
                }  
            }else{  
            	System.out.println("没有数据.");
                //flag = -1;  
            }
			
			//下列添加的对字体等的设置均调试通过，可作参考用   
			  
			  
			//添加数字    
			//jxl.write.Number number = new  jxl.write.Number( 3 ,  4 ,  3.14159 );  //put the number 3.14159 in cell D5   
			//sheet.addCell(number);  
			  
			//添加带有字型Formatting的对象    
			//jxl.write.WritableFont wf = new  jxl.write.WritableFont(WritableFont.TIMES, 10 ,WritableFont.BOLD, true );   
			//jxl.write.WritableCellFormat wcfF = new  jxl.write.WritableCellFormat(wf);   
			//jxl.write.Label labelCF = new  jxl.write.Label( 4 , 4 , "文本" ,wcfF);   
			//sheet.addCell(labelCF);     
			  
			//添加带有formatting的Number对象     
			//jxl.write.NumberFormat nf = new  jxl.write.NumberFormat( "#.##" );   
			//jxl.write.WritableCellFormat wcfN = new  jxl.write.WritableCellFormat(nf);   
			//jxl.write.Number labelNF = new  jxl.write.Number( 1 , 1 , 3.1415926 ,wcfN);   
			//sheet.addCell(labelNF);   
			  
			//3.添加Boolean对象    
			//jxl.write.Boolean labelB = new  jxl.write.Boolean( 0 , 2 , false );   
			//sheet.addCell(labelB);   
			  
			//4.添加DateTime对象    
			//jxl.write.DateTime labelDT = new  jxl.write.DateTime( 0 , 3 , new  java.util.Date());   
			//sheet.addCell(labelDT);   
			  
			//添加带有formatting的DateFormat对象    
			//jxl.write.DateFormat df = new  jxl.write.DateFormat( "ddMMyyyyhh:mm:ss" );   
			//jxl.write.WritableCellFormat wcfDF = new  jxl.write.WritableCellFormat(df);   
			//jxl.write.DateTime labelDTF = new  jxl.write.DateTime( 1 , 3 , new  java.util.Date(),wcfDF);   
			//sheet.addCell(labelDTF);
			  
			//设置边框   
			//jxl.write.WritableCellFormat wcsB = new  jxl.write.WritableCellFormat();   
			//wcsB.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THICK);  
			//labelCFC = new  jxl.write.Label( 0 , 6 , "边框设置" ,wcsB);   
			//sheet.addCell(labelCFC);
            
			workbook.write();
			workbook.close();
			 //关闭流  
            os.flush();  
            os.close(); 
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		System.out.println("end" ); 
    }
	
	/** 
     * @author  
     * @param objData 导出内容数组 
     * @param sheetName 导出工作表的名称 
     * @param columns 导出Excel的表头数组 
     * @return 
     */  
    public static int exportToExcel(HttpServletResponse response, List<Map<String, Object>> objData, String sheetName, List<String> columns) {
        int flag = 0;  
        //声明工作簿jxl.write.WritableWorkbook  
        WritableWorkbook wwb;  
        try {  
            //根据传进来的file对象创建可写入的Excel工作薄  
            OutputStream os = response.getOutputStream();  
              
            wwb = Workbook.createWorkbook(os);  
  
            /* 
             * 创建一个工作表、sheetName为工作表的名称、"0"为第一个工作表 
             * 打开Excel的时候会看到左下角默认有3个sheet、"sheet1、sheet2、sheet3"这样 
             * 代码中的"0"就是sheet1、其它的一一对应。 
             * createSheet(sheetName, 0)一个是工作表的名称，另一个是工作表在工作薄中的位置 
             */  
            WritableSheet ws = wwb.createSheet(sheetName, 0);  
              
            SheetSettings ss = ws.getSettings();  
            ss.setVerticalFreeze(1);//冻结表头  
              
            WritableFont font1 =new WritableFont(WritableFont.createFont("微软雅黑"), 10 ,WritableFont.BOLD);  
            WritableFont font2 =new WritableFont(WritableFont.createFont("微软雅黑"), 9 ,WritableFont.NO_BOLD);  
            WritableCellFormat wcf = new WritableCellFormat(font1);  
            WritableCellFormat wcf2 = new WritableCellFormat(font2);  
            WritableCellFormat wcf3 = new WritableCellFormat(font2);//设置样式，字体  
  
            //创建单元格样式  
            //WritableCellFormat wcf = new WritableCellFormat();  
  
            //背景颜色  
            wcf.setBackground(jxl.format.Colour.YELLOW);  
            wcf.setAlignment(Alignment.CENTRE);  //平行居中  
            wcf.setVerticalAlignment(VerticalAlignment.CENTRE);  //垂直居中  
            wcf3.setAlignment(Alignment.CENTRE);  //平行居中  
            wcf3.setVerticalAlignment(VerticalAlignment.CENTRE);  //垂直居中  
            wcf3.setBackground(Colour.LIGHT_ORANGE);  
            wcf2.setAlignment(Alignment.CENTRE);  //平行居中  
            wcf2.setVerticalAlignment(VerticalAlignment.CENTRE);  //垂直居中  
  
            /* 
             * 这个是单元格内容居中显示 
             * 还有很多很多样式 
             */  
            wcf.setAlignment(Alignment.CENTRE);  
  
            //判断一下表头数组是否有数据  
            if (columns != null && columns.size() > 0) {  
  
                //循环写入表头  
                for (int i = 0; i < columns.size(); i++) {  
  
                    /* 
                     * 添加单元格(Cell)内容addCell() 
                     * 添加Label对象Label() 
                     * 数据的类型有很多种、在这里你需要什么类型就导入什么类型 
                     * 如：jxl.write.DateTime 、jxl.write.Number、jxl.write.Label 
                     * Label(i, 0, columns[i], wcf) 
                     * 其中i为列、0为行、columns[i]为数据、wcf为样式 
                     * 合起来就是说将columns[i]添加到第一行(行、列下标都是从0开始)第i列、样式为什么"色"内容居中 
                     */  
                    ws.addCell(new Label(i, 0, columns.get(i), wcf));  
                }  
  
                //判断表中是否有数据  
                if (objData != null && objData.size() > 0) {  
                    //循环写入表中数据  
                    for (int i = 0; i < objData.size(); i++) {  
  
                        //转换成map集合{activyName:测试功能,count:2}  
                        Map<String, Object> map = (Map<String, Object>)objData.get(i);  
  
                        //循环输出map中的子集：既列值  
                        int j=0;  
                        for(Object o:map.keySet()){  
                            //ps：因为要“”通用”“导出功能，所以这里循环的时候不是get("Name"),而是通过map.get(o)  
                            ws.addCell(new Label(j,i+1,String.valueOf(map.get(o))));  
                            j++;  
                        }  
                    }  
                }else{  
                    flag = -1;  
                }  
  
                //写入Exel工作表  
                wwb.write();  
  
                //关闭Excel工作薄对象   
                wwb.close();  
                  
                //关闭流  
                os.flush();  
                os.close();  
                  
                os =null;  
            }  
        }catch (IllegalStateException e) {  
            System.err.println(e.getMessage());  
        }  
        catch (Exception ex) {  
            flag = 0;  
            ex.printStackTrace();  
        }  
  
        return flag;  
    }  
  
    public static void doctorToExcel(HttpServletResponse response, List<Map<String, Object>> objData, String sheetName, List<String> columns) {
		
		WritableWorkbook workbook;
		try {
			OutputStream os = response.getOutputStream();
			workbook=Workbook.createWorkbook(os);
			
			WritableSheet sheet = workbook.createSheet(sheetName, 0 );  //添加第一个工作表
			
			jxl.write.WritableFont wft = new  jxl.write.WritableFont(WritableFont.ARIAL, 10 ,WritableFont.BOLD, false ,jxl.format.UnderlineStyle.NO_UNDERLINE,jxl.format.Colour.BLACK);   
			jxl.write.WritableCellFormat wcfFT = new jxl.write.WritableCellFormat(wft); 
			wcfFT.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			//wcfFT.setWrap(true);
			jxl.write.WritableFont wfcc = new  jxl.write.WritableFont(WritableFont.ARIAL, 10 ,WritableFont.NO_BOLD, false ,jxl.format.UnderlineStyle.NO_UNDERLINE,jxl.format.Colour.BLACK);   
			jxl.write.WritableCellFormat wfcf = new  jxl.write.WritableCellFormat(wfcc); 
			wfcf.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			wfcf.setWrap(true);
			
			//合并单元格   
			//sheet.mergeCells(int col1,int row1,int col2,int row2);//左上角到右下角   
			sheet.mergeCells(0, 0, 24, 1); //左上角到右下角   
			jxl.write.WritableFont wfc = new  jxl.write.WritableFont(WritableFont.ARIAL, 20 ,WritableFont.BOLD, false ,jxl.format.UnderlineStyle.NO_UNDERLINE,jxl.format.Colour.BLACK);   
			jxl.write.WritableCellFormat wchB = new  jxl.write.WritableCellFormat(wfc);   
			wchB.setAlignment(jxl.format.Alignment.CENTRE);  
			wchB.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			
			jxl.write.Label labelCFC = new  jxl.write.Label( 0 , 0 , "医生信息统计" ,wchB);   
			sheet.addCell(labelCFC); 
			sheet.setColumnView(3, 10);
			sheet.setColumnView(7, 25);
			sheet.setColumnView(9, 12);
			sheet.setColumnView(10, 12);
			sheet.setColumnView(11, 28);
			sheet.setColumnView(12, 28);
			sheet.setColumnView(13, 28);
			sheet.setColumnView(14, 28);
			sheet.setColumnView(15, 28);
			sheet.setColumnView(16, 28);
			sheet.setColumnView(17, 28);
			sheet.setColumnView(18, 28);
			sheet.setColumnView(19, 28);
			sheet.setColumnView(20, 28);
			sheet.setColumnView(21, 28);
			sheet.setColumnView(22, 28);
			sheet.setColumnView(23, 28);
			sheet.setColumnView(24, 12);
//			jxl.write.Label label;  
//			for  ( int  i= 0 ; i<title.length; i++)  
//			{  
//				//Label(列号,行号 ,内容 )   
//				label = new  jxl.write.Label(i,  2, title[i], wcfFT);  //put the title in row1    
//				sheet.addCell(label);   
//			}	  
			
			//循环写入表头  
            for (int i = 0; i < columns.size(); i++) {  

                /* 
                 * 添加单元格(Cell)内容addCell() 
                 * 添加Label对象Label() 
                 * 数据的类型有很多种、在这里你需要什么类型就导入什么类型 
                 * 如：jxl.write.DateTime 、jxl.write.Number、jxl.write.Label 
                 * Label(i, 0, columns[i], wcf) 
                 * 其中i为列、0为行、columns[i]为数据、wcf为样式 
                 * 合起来就是说将columns[i]添加到第一行(行、列下标都是从0开始)第i列、样式为什么"色"内容居中 
                 */  
            	sheet.addCell(new Label(i, 2, columns.get(i), wcfFT));  
            } 
			
			//判断表中是否有数据  
            if (objData != null && objData.size() > 0) {  
                //循环写入表中数据  
                for (int i = 0; i < objData.size(); i++) {  

                    //转换成map集合{activyName:测试功能,count:2}  
                    Map<String, Object> map = (Map<String, Object>)objData.get(i);  

                    //循环输出map中的子集：既列值  
                    sheet.addCell(new Label(0, i + 3, String.valueOf(i+1), wfcf));
                    String patientName = String.valueOf(map.get("realname"));
                    if (patientName == null || patientName.equals("null") || patientName.equals("")) {
                    	patientName = "/";
                    }
                    sheet.addCell(new Label(1, i + 3, patientName, wfcf));
                    if (String.valueOf(map.get("sex")).equals("0")) {
                    	//System.out.println("男");
                    	sheet.addCell(new Label(2, i + 3, "男", wfcf));
                    } else {
                    	//System.out.println("女");
                    	sheet.addCell(new Label(2, i + 3, "女", wfcf));
                    }
                    String title = String.valueOf(map.get("title"));
                    if (title == null || title.equals("null") || title.equals("")) {
                    	title = "/";
                    }
                    sheet.addCell(new Label(3, i + 3, title, wfcf));
                    sheet.addCell(new Label(4, i + 3, String.valueOf(map.get("provincename")), wfcf));
                    sheet.addCell(new Label(5, i + 3, String.valueOf(map.get("cityname")), wfcf));
                    sheet.addCell(new Label(6, i + 3, String.valueOf(map.get("areaName")), wfcf));
                    sheet.addCell(new Label(7, i + 3, String.valueOf(map.get("hospitalname")), wfcf));
                    sheet.addCell(new Label(8, i + 3, String.valueOf(map.get("loginCount")), wfcf));
                    sheet.addCell(new Label(9, i + 3, String.valueOf(map.get("mobilePhone")), wfcf));
                    
                    //上报确诊例数
                    String comfirmNum = String.valueOf(map.get("comfirmNum"));
                    if (comfirmNum == null || comfirmNum.equals("null") || comfirmNum.equals("")) {
                    	comfirmNum = "0";
                    }
                    sheet.addCell(new Label(10, i + 3, comfirmNum, wfcf));
                    
//                    //总录入患儿数量
//                    String totalPatientNum = String.valueOf(map.get("totalPatientNum"));
//                    if (totalPatientNum == null || totalPatientNum.equals("null") || totalPatientNum.equals("")) {
//                    	totalPatientNum = "0";
//                    }
//                    sheet.addCell(new Label(11, i + 3, totalPatientNum, wfcf));
//                    
//                    //年度患儿数量
//                    String yearNewPatientNum = String.valueOf(map.get("yearNewPatientNum"));
//                    if (yearNewPatientNum == null || yearNewPatientNum.equals("null") || yearNewPatientNum.equals("")) {
//                    	yearNewPatientNum = "0";
//                    }
//                    sheet.addCell(new Label(12, i + 3, yearNewPatientNum, wfcf));
//                    
//                    //年度新生儿数量
//                    String yearNewBirthNum = String.valueOf(map.get("yearNewBirthNum"));
//                    if (yearNewBirthNum == null || yearNewBirthNum.equals("null") || yearNewBirthNum.equals("")) {
//                    	yearNewBirthNum = "0";
//                    }
//                    sheet.addCell(new Label(13, i + 3, yearNewBirthNum, wfcf));
                    
                    
                    
//                    sheet.addCell(new Label(14, i + 3, String.valueOf(map.get("coverRate")), wfcf));
//                    sheet.addCell(new Label(15, i + 3, String.valueOf(map.get("comfirmRate")), wfcf));
                    
                  //1月0-6岁患儿数量
                    String Jan = String.valueOf(map.get("Jan"));
                    if (Jan == null || Jan.equals("null") || Jan.equals("")) {
                    	Jan = "0";
                    }
                    sheet.addCell(new Label(11, i + 3, Jan, wfcf));
                  //2月0-6岁患儿数量
                    String Feb = String.valueOf(map.get("Feb"));
                    if (Feb == null || Feb.equals("null") || Feb.equals("")) {
                    	Feb = "0";
                    }
                    sheet.addCell(new Label(12, i + 3, Feb, wfcf));
                    
                  //3月0-6岁患儿数量
                    String Mar = String.valueOf(map.get("Mar"));
                    if (Mar == null || Mar.equals("null") || Mar.equals("")) {
                    	Mar = "0";
                    }
                    sheet.addCell(new Label(13, i + 3, Mar, wfcf));
                  //4月0-6岁患儿数量
                    String Apr = String.valueOf(map.get("Apr"));
                    if (Apr == null || Apr.equals("null") || Apr.equals("")) {
                    	Apr = "0";
                    }
                    sheet.addCell(new Label(14, i + 3, Apr, wfcf));
                    
                  //5月0-6岁患儿数量
                    String May = String.valueOf(map.get("May"));
                    if (May == null || May.equals("null") || May.equals("")) {
                    	May = "0";
                    }
                    sheet.addCell(new Label(15, i + 3, May, wfcf));
                  //6月0-6岁患儿数量
                    String Jun = String.valueOf(map.get("lastMonthNum"));
                    if (Jun == null || Jun.equals("null") || Jun.equals("")) {
                    	Jun = "0";
                    }
                    sheet.addCell(new Label(16, i + 3, Jun, wfcf));
                    
                  //7月0-6岁患儿数量
                    String Jul = String.valueOf(map.get("Jul"));
                    if (Jul == null || Jul.equals("null") || Jul.equals("")) {
                    	Jul = "0";
                    }
                    sheet.addCell(new Label(17, i + 3, Jul, wfcf));
                  //8月0-6岁患儿数量
                    String Aug = String.valueOf(map.get("Aug"));
                    if (Aug == null || Aug.equals("null") || Aug.equals("")) {
                    	Aug = "0";
                    }
                    sheet.addCell(new Label(18, i + 3, Aug, wfcf));
                    
                  //9月0-6岁患儿数量
                    String Sep = String.valueOf(map.get("Sep"));
                    if (Sep == null || Sep.equals("null") || Sep.equals("")) {
                    	Sep = "0";
                    }
                    sheet.addCell(new Label(19, i + 3, Sep, wfcf));
                  //10月0-6岁患儿数量
                    String Oct = String.valueOf(map.get("Oct"));
                    if (Oct == null || Oct.equals("null") || Oct.equals("")) {
                    	Oct = "0";
                    }
                    sheet.addCell(new Label(20, i + 3, Oct, wfcf));
                    
                  //11月0-6岁患儿数量
                    String Nov = String.valueOf(map.get("Nov"));
                    if (Nov == null || Nov.equals("null") || Nov.equals("")) {
                    	Nov = "0";
                    }
                    sheet.addCell(new Label(21, i + 3, Nov, wfcf));
                  //12月0-6岁患儿数量
                    String Dec = String.valueOf(map.get("Dec"));
                    if (Dec == null || Dec.equals("null") || Dec.equals("")) {
                    	Dec = "0";
                    }
                    sheet.addCell(new Label(22, i + 3, Dec, wfcf));
                    
                  //今年0-6岁患儿数量
                    String thisYearNum = String.valueOf(map.get("thisYearNum"));
                    if (thisYearNum == null || thisYearNum.equals("null") || thisYearNum.equals("")) {
                    	thisYearNum = "0";
                    }
                    sheet.addCell(new Label(23, i + 3, thisYearNum, wfcf));
                    
                    
                    
                    //有照片患儿数量
                    String hasPicNum = String.valueOf(map.get("hasPicNum"));
                    if (hasPicNum == null || hasPicNum.equals("null") || hasPicNum.equals("")) {
                    	hasPicNum = "0";
                    }
                    sheet.addCell(new Label(24, i + 3, hasPicNum, wfcf));
                          
                }
                
                //写入Exel工作表  
                workbook.write();  
  
                //关闭Excel工作薄对象   
                workbook.close();  
                  
                //关闭流  
                os.flush();  
                os.close();  
                  
                os =null; 
            }else{  
            	System.out.println("没有数据.");
            	//写入Exel工作表  
                workbook.write();  
  
                //关闭Excel工作薄对象   
                workbook.close();  
                  
                //关闭流  
                os.flush();  
                os.close();  
                  
                os =null;
                //flag = -1;  
            }
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
    
    /** 
     * 下载excel 
     * @author  
     * @param response 
     * @param filename 文件名 ,如:20110808.xls 
     * @param listData 数据源 
     * @param sheetName 表头名称 
     * @param columns 列名称集合,如：{物品名称，数量，单价} 
     */  
    public static void exportexcle(HttpServletResponse response, String filename, List<Map<String, Object>> listData, String sheetName, List<String> columns)
    {  
        //调用上面的方法、生成Excel文件  
        response.setContentType("application/vnd.ms-excel");  
        //response.setHeader("Content-Disposition", "attachment;filename="+filename);  
        try {  
            response.setHeader("Content-Disposition", "attachment;filename=" + new String(filename.getBytes("gb2312"), "ISO8859-1") + ".xls");  
  
            exportToExcel(response, listData, sheetName, columns);  
        } catch (UnsupportedEncodingException e) {  
            e.printStackTrace();  
        }   
  
  
    }
    
    /**
     * 红包信息导出
     * @param redBagList
     * @param sheetName
     * @param columns
     */
	public static void redBagToExcel(HttpServletResponse response,
			List<Map<String, String>> redBagList, List<Map<String, String>> redBagSta, 
			String sheetName,List<String> columns) {
		
		OutputStream os = null;
		WritableWorkbook workbook = null;
		
		try{
			os = response.getOutputStream();
			workbook=Workbook.createWorkbook(os);
			WritableSheet sheet = workbook.createSheet(sheetName, 0 ); //添加第一个工作表
				
			jxl.write.WritableFont wft = new  jxl.write.WritableFont(WritableFont.ARIAL, 10 ,WritableFont.BOLD, false ,jxl.format.UnderlineStyle.NO_UNDERLINE,jxl.format.Colour.BLACK);   
			jxl.write.WritableCellFormat wcfFT = new jxl.write.WritableCellFormat(wft); 
			wcfFT.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			//wcfFT.setWrap(true);
			jxl.write.WritableFont wfcc = new  jxl.write.WritableFont(WritableFont.ARIAL, 10 ,WritableFont.NO_BOLD, false ,jxl.format.UnderlineStyle.NO_UNDERLINE,jxl.format.Colour.BLACK);   
			jxl.write.WritableCellFormat wfcf = new  jxl.write.WritableCellFormat(wfcc); 
			wfcf.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			wfcf.setWrap(true);
			
			//合并单元格   
			//sheet.mergeCells(int col1,int row1,int col2,int row2);//左上角到右下角   
			sheet.mergeCells(0, 0, 6, 1); //左上角到右下角   
			jxl.write.WritableFont wfc = new  jxl.write.WritableFont(WritableFont.ARIAL, 20 ,WritableFont.BOLD, false ,jxl.format.UnderlineStyle.NO_UNDERLINE,jxl.format.Colour.BLACK);   
			jxl.write.WritableCellFormat wchB = new  jxl.write.WritableCellFormat(wfc);   
			wchB.setAlignment(jxl.format.Alignment.CENTRE);  
			wchB.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			
			jxl.write.Label labelCFC = new  jxl.write.Label( 0 , 0 , "红包信息统计" ,wchB);
			sheet.addCell(labelCFC); 
			
			//设置列宽
			sheet.setColumnView(1, 30);
			sheet.setColumnView(4, 10);
			sheet.setColumnView(5, 10);
			sheet.setColumnView(6, 25);
			
			//循环写入表头  
            for (int i = 0; i < columns.size(); i++) {  

            	sheet.addCell(new Label(i, 2, columns.get(i), wcfFT));  
            } 
            
            if(redBagList != null || redBagList.size() != 0){
            	
            	//循环写出数据
            	for(int i = 0;i<redBagList.size();i++){
            		
            		Map<String,String> redBag = redBagList.get(i);
            		
            		//在Excel列里面写出红包信息
            		
            		sheet.addCell(new Label(0,i+3,String.valueOf(i+1),wfcf));  //序号
            		sheet.addCell(new Label(1,i+3,String.valueOf(redBag.get("wish")),wfcf));   //信息
            		sheet.addCell(new Label(2,i+3,String.valueOf(redBag.get("money")),wfcf));  //金额
            		sheet.addCell(new Label(3,i+3,String.valueOf(redBag.get("bagNum")),wfcf));   //个数
            		sheet.addCell(new Label(4,i+3,String.valueOf(redBag.get("lyMoney")),wfcf));   //领用金额
            		sheet.addCell(new Label(5,i+3,String.valueOf(redBag.get("lyBagNum")),wfcf));   //领用个数
            		sheet.addCell(new Label(6,i+3,String.valueOf(redBag.get("createTime")),wfcf));   //时间
            		
            	}
            	
            	//写入总金额 和领用金额
            	
            	sheet.addCell(new Label(0,redBagList.size()+3,"统计",wfcf));
            	sheet.addCell(new Label(1,redBagList.size()+3,"",wfcf));
            	sheet.addCell(new Label(2,redBagList.size()+3,
            			String.valueOf(redBagSta.get(0).get("totalMoney")),wfcf));
            	sheet.addCell(new Label(3,redBagList.size()+3,"",wfcf));
            	sheet.addCell(new Label(4,redBagList.size()+3,
            			String.valueOf(redBagSta.get(0).get("lyMoney")),wfcf));
            	sheet.addCell(new Label(5,redBagList.size()+3,"",wfcf));
            	sheet.addCell(new Label(6,redBagList.size()+3,"",wfcf));
            	//写入Exel工作表  
                workbook.write();  
            }
            
            //关闭Excel工作薄对象   
            workbook.close();  
              
            //关闭流  
            os.flush();  
            os.close();  
              
            os =null; 
            
		}catch(Exception e){
			e.printStackTrace();
		}
			
	}

	/**
	 * 婴幼儿健康状况调查表导出
	 * @param response
	 * @param babyHealth
	 * @param sheetName
	 * @throws Exception 
	 */
	public static void babyHealthToExcel(HttpServletResponse response,
			Map<String, Object> babyHealth, String sheetName) throws Exception {
		
		OutputStream os = response.getOutputStream();
		WritableWorkbook workbook = Workbook.createWorkbook(os);
		
		try{
			
			//添加第一个工作表
			WritableSheet sheet = workbook.createSheet(sheetName, 0);
			
			//第一种画笔
			WritableFont wft = new WritableFont(WritableFont.ARIAL,16,WritableFont.BOLD,false,UnderlineStyle.NO_UNDERLINE, Colour.BLACK);
			WritableCellFormat wcfmt = new WritableCellFormat(wft);
			wcfmt.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			wcfmt.setAlignment(Alignment.CENTRE);
			wcfmt.setWrap(true);
			
			//第二种画笔
			WritableFont wft1 = new WritableFont(WritableFont.ARIAL,10,WritableFont.NO_BOLD,false,UnderlineStyle.NO_UNDERLINE,Colour.BLACK);
			WritableCellFormat wcfmt1 = new WritableCellFormat(wft1);
			wcfmt1.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			wcfmt1.setWrap(true);
			
			//第三种画笔
			WritableFont wft2 = new WritableFont(WritableFont.ARIAL,10,WritableFont.BOLD,false,UnderlineStyle.NO_UNDERLINE,Colour.BLACK);
			WritableCellFormat wcfmt2 = new WritableCellFormat(wft2);
			wcfmt2.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			wcfmt2.setWrap(true);
			
			//设置列宽
			sheet.setColumnView(0, 9);
			sheet.setColumnView(1, 9);
			sheet.setColumnView(2, 9);
			sheet.setColumnView(3, 9);
			sheet.setColumnView(4, 10);
			sheet.setColumnView(5, 9);
			sheet.setColumnView(6, 9);
			sheet.setColumnView(7, 9);
			sheet.setColumnView(8, 9);
			sheet.setColumnView(9, 9);
			sheet.setColumnView(10, 10);
			sheet.setColumnView(11, 9);
			sheet.setColumnView(12, 9);
			sheet.setColumnView(13, 9);
			
			//设置行高
			sheet.setRowView(0, 800);
			sheet.setRowView(1, 400);
			sheet.setRowView(2, 400);
			sheet.setRowView(3, 400);
			sheet.setRowView(4, 400);
			sheet.setRowView(5, 400);
			sheet.setRowView(6, 400);
			sheet.setRowView(7, 400);
			sheet.setRowView(8, 400);
			sheet.setRowView(9, 400);
			sheet.setRowView(10, 400);
			sheet.setRowView(11, 400);
			sheet.setRowView(12, 400);
			sheet.setRowView(13, 400);
			sheet.setRowView(14, 400);
			sheet.setRowView(15, 400);
			sheet.setRowView(16, 400);
			sheet.setRowView(17, 400);
			sheet.setRowView(18, 400);
			sheet.setRowView(19, 400);
			sheet.setRowView(20, 400);
			sheet.setRowView(21, 400);
			sheet.setRowView(22, 400);
			sheet.setRowView(23, 400);
			sheet.setRowView(24, 400);
			
			//写出内容
			//表头
			//合并单元格
			sheet.mergeCells(0, 0, 13, 0);
			//添加内容
			sheet.addCell(new Label(0,0,"安徽省婴幼儿健康状况调查表",wcfmt));
			//编号行
			sheet.mergeCells(0, 1, 10, 1);
			sheet.addCell(new Label(0, 1, "", wcfmt1));
			sheet.addCell(new Label(11, 1,"编号", wcfmt1));
			sheet.mergeCells(12, 1, 13 ,1 );
			String id = String.valueOf(babyHealth.get("id"));    //编号
			sheet.addCell(new Label(12, 1, id, wcfmt1));
			
			//第一行
			sheet.mergeCells(0, 2, 1, 2);
			sheet.addCell(new Label(0,2,"检查单位",wcfmt1));
			sheet.mergeCells(2, 2, 6, 2);
			String hospital = String.valueOf(babyHealth.get("hospital"));
			if(StringUtils.isBlank(hospital)||hospital.equals("null")){
				hospital = "/";
			}
			sheet.addCell(new Label(2,2,hospital,wcfmt1));
			
			sheet.mergeCells(7, 2, 8, 2);
			sheet.addCell(new Label(7,2,"出生证号码",wcfmt1));
			sheet.mergeCells(9, 2, 13, 2);
			String birthNum = String.valueOf(babyHealth.get("birthNum"));
			if(StringUtils.isBlank(birthNum)||birthNum.equals("null")){
				birthNum = "/";
			}
			sheet.addCell(new Label(9,2,birthNum,wcfmt1));
			
			//第二行
			sheet.mergeCells(0, 3, 1, 3);
			sheet.addCell(new Label(0,3,"婴儿姓名",wcfmt1));
			sheet.mergeCells(2, 3, 6, 3);
			String patientName = String.valueOf(babyHealth.get("patientName"));
			if(StringUtils.isBlank(patientName)||patientName.equals("null")){
				patientName = "/";
			}
			sheet.addCell(new Label(2,3,patientName,wcfmt1));
			
			sheet.mergeCells(7, 3, 8, 3);
			sheet.addCell(new Label(7,3,"性别",wcfmt1));
			sheet.mergeCells(9, 3, 13, 3);
			String sex = String.valueOf(babyHealth.get("sex"));
			if(StringUtils.isBlank(sex)||sex.equals("null")){
				sex = "/";
			}else{
				if("0".equals(sex)){
					sex = "男";
				}else if("1".equals(sex)){
					sex = "女";
				}else{
					sex = "/";
				}
			}
			
			sheet.addCell(new Label(9,3,sex,wcfmt1));
			
			//第三行
			sheet.mergeCells(0, 4, 1, 4);
			sheet.addCell(new Label(0,4,"出生时间",wcfmt1));
			sheet.mergeCells(2, 4, 6, 4);
			String birthday = String.valueOf(babyHealth.get("birthday"));
			String birthTime = String.valueOf(babyHealth.get("birthTime"));
			if(StringUtils.isBlank(birthday)||birthday.equals("null")){
				birthday = " / 年  / 月  / 日   ";
			}else{
				System.out.println("birthday = " + birthday);
				birthday = " " + birthday.substring(0,4) + " 年 "
						 + " " + birthday.substring(5,7) + " 月  "
						 + " " + birthday.substring(8,10) + " 日 ";
			}
			if(StringUtils.isBlank(birthTime)||birthTime.equals("null")){
				birthTime = " / 时";
			}else{
				birthTime = " " + birthTime + " 时";
			}
			
			sheet.addCell(new Label(2,4,(birthday + birthTime) ,wcfmt1));
			
			sheet.mergeCells(7, 4, 8, 4);
			sheet.addCell(new Label(7,4,"调查日期",wcfmt1));
			sheet.mergeCells(9, 4, 13, 4);
			String createTime = String.valueOf(babyHealth.get("createTime"));
			if(StringUtils.isBlank(createTime)||createTime.equals("null")){
				createTime = " / 年  / 月  / 日   ";
			}else{
				createTime = " " + createTime.substring(0,4) + " 年 "
						   + " " + createTime.substring(5,7) + " 月  "
						   + " " + createTime.substring(8,10) + " 日 ";
			}
			String surveyTime = String.valueOf(babyHealth.get("surveyTime"));
			if(StringUtils.isBlank(surveyTime)||surveyTime.equals("null")){
				surveyTime = " / 时";
			}else{
				surveyTime = " " + surveyTime + " 时";
			}
			sheet.addCell(new Label(9,4,(createTime + surveyTime),wcfmt1));
			
			//第四行
			sheet.mergeCells(0, 5, 1, 5);
			sheet.addCell(new Label(0,5,"母亲姓名",wcfmt1));
			String mum = String.valueOf(babyHealth.get("mum"));
			if(StringUtils.isBlank(mum)||mum.equals("null")){
				mum = "/";
			}
			sheet.addCell(new Label(2,5,mum,wcfmt1));
			
			sheet.addCell(new Label(3,5,"民族",wcfmt1));
			String mumNation = String.valueOf(babyHealth.get("mumNation"));
			if(StringUtils.isBlank(mumNation)||mumNation.equals("null")){
				mumNation = "/";
			}
			sheet.addCell(new Label(4,5,mumNation,wcfmt1));
			
			sheet.addCell(new Label(5,5,"学历",wcfmt1));
			String mumEducation = String.valueOf(babyHealth.get("mumEducation"));
			if(StringUtils.isBlank(mumEducation)||mumEducation.equals("null")){
				mumEducation = "/";
			}
			sheet.addCell(new Label(6,5,mumEducation,wcfmt1));
			
			sheet.mergeCells(7, 5, 8, 5);
			sheet.addCell(new Label(7,5,"联系电话",wcfmt1));
			sheet.mergeCells(9, 5, 13, 5);
			String mumTel = String.valueOf(babyHealth.get("mumTel"));
			if(StringUtils.isBlank(mumTel)||mumTel.equals("null")){
				mumTel = "/";
			}
			sheet.addCell(new Label(9,5,mumTel,wcfmt1));
			
			//第五行
			sheet.mergeCells(0, 6, 1, 6);
			sheet.addCell(new Label(0,6,"父亲姓名",wcfmt1));
			String dad = String.valueOf(babyHealth.get("dad"));
			if(StringUtils.isBlank(dad)||dad.equals("null")){
				dad = "/";
			}
			sheet.addCell(new Label(2,6,dad,wcfmt1));
			
			sheet.addCell(new Label(3,6,"民族",wcfmt1));
			String dadNation = String.valueOf(babyHealth.get("dadNation"));
			if(StringUtils.isBlank(dadNation)||dadNation.equals("null")){
				dadNation = "/";
			}
			sheet.addCell(new Label(4,6,dadNation,wcfmt1));
			
			sheet.addCell(new Label(5,6,"学历",wcfmt1));
			String dadEducation = String.valueOf(babyHealth.get("dadEducation"));
			if(StringUtils.isBlank(dadEducation)||dadEducation.equals("null")){
				dadEducation = "/";
			}
			sheet.addCell(new Label(6,6,dadEducation,wcfmt1));
			
			sheet.mergeCells(7, 6, 8, 6);
			sheet.addCell(new Label(7,6,"联系电话",wcfmt1));
			sheet.mergeCells(9, 6, 13, 6);
			String dadTel = String.valueOf(babyHealth.get("dadTel"));
			if(StringUtils.isBlank(dadTel)||dadTel.equals("null")){
				dadTel = "/";
			}
			sheet.addCell(new Label(9,6,dadTel,wcfmt1));
			
			//第六行
			sheet.mergeCells(0, 7, 1, 7);
			sheet.addCell(new Label(0,7,"家庭住址",wcfmt1));
			sheet.mergeCells(2, 7, 6, 7);
			String address = String.valueOf(babyHealth.get("address"));
			if(StringUtils.isBlank(address)||address.equals("null")){
				address = "/";
			}
			sheet.addCell(new Label(2,7,address,wcfmt1));
			
			sheet.mergeCells(7, 7, 8, 7);
			sheet.addCell(new Label(7,7,"户籍",wcfmt1));
			sheet.mergeCells(9, 7, 13, 7);
			String register = String.valueOf(babyHealth.get("register"));
			if(StringUtils.isBlank(register)||register.equals("null")){
				register = "/";
			}
			sheet.addCell(new Label(9,7,register,wcfmt1));
			
			//第七行
			sheet.mergeCells(0, 8, 6, 8);
			sheet.addCell(new Label(0,8,"家族血亲三代有无血管瘤或脉管畸形病史",wcfmt2));
			sheet.mergeCells(7, 8, 13, 8);
			String jzsxm = String.valueOf(babyHealth.get("jzsxm"));
			if(StringUtils.isBlank(jzsxm)||jzsxm.equals("null")){
				jzsxm = "/";
			}else{
				if("0".equals(jzsxm)){
					jzsxm = "否";
				}else if("1".equals(jzsxm)){
					jzsxm = "是";
				}else{
					jzsxm = "/";
				}
			}
			sheet.addCell(new Label(7,8,jzsxm,wcfmt1));
			
			//第八行
			sheet.mergeCells(0, 9, 6, 9);
			sheet.addCell(new Label(0,9,"兄弟姐妹有无血管瘤或脉管畸形病史",wcfmt2));
			sheet.mergeCells(7, 9, 13, 9);
			String xdjmxm = String.valueOf(babyHealth.get("xdjmxm"));
			if(StringUtils.isBlank(xdjmxm)||xdjmxm.equals("null")){
				xdjmxm = "/";
			}else{
				if("0".equals(xdjmxm)){
					xdjmxm = "否";
				}else if("1".equals(xdjmxm)){
					xdjmxm = "是";
				}else{
					xdjmxm = "/";
				}
			}
			sheet.addCell(new Label(7,9,xdjmxm,wcfmt1));
			
			//第九行
			sheet.mergeCells(0, 10, 1, 10);
			sheet.addCell(new Label(0,10,"孕产史",wcfmt2));
			String yunChan = String.valueOf(babyHealth.get("yunChan"));
			if(StringUtils.isBlank(yunChan)||yunChan.equals("null")){
				yunChan = "/";
			}else{
				if("0".equals(yunChan)){
					yunChan = "否";
				}else if("1".equals(yunChan)){
					yunChan = "是";
				}else{
					yunChan = "/";
				}
			}
			sheet.addCell(new Label(2,10,yunChan,wcfmt1));
			
			sheet.addCell(new Label(3,10,"孕"));
			String yunNum = String.valueOf(babyHealth.get("yunNum"));
			if(StringUtils.isBlank(yunNum)||yunNum.equals("null")){
				yunNum = "/";
			}
			sheet.addCell(new Label(4,10,yunNum + " 次",wcfmt1));
			
			sheet.addCell(new Label(5,10,"产"));
			String chanNum = String.valueOf(babyHealth.get("chanNum"));
			if(StringUtils.isBlank(chanNum)||chanNum.equals("null")){
				chanNum = "/";
			}
			sheet.addCell(new Label(6,10,chanNum + " 胎",wcfmt1));
			
			sheet.mergeCells(7, 10, 8, 10);
			sheet.addCell(new Label(7,10,"此孩怀孕年龄",wcfmt1));
			sheet.mergeCells(9, 10, 13, 10);
			String yunAge = String.valueOf(babyHealth.get("yunAge"));
			if(StringUtils.isBlank(yunAge)||yunAge.equals("null")){
				yunAge = "/";
			}
			sheet.addCell(new Label(9,10,yunAge,wcfmt1));
			
			//第十行
			sheet.mergeCells(0, 11, 1, 11);
			sheet.addCell(new Label(0,11,"孕期药物治疗史",wcfmt2));
			sheet.addCell(new Label(2,11,"黄体酮",wcfmt1));
			String drugHistory = String.valueOf(babyHealth.get("drugHistory"));
			drugHistory = drugHistory.replace("0", "×");
			drugHistory = drugHistory.replace("1", "√");
			
			sheet.addCell(new Label(3,11,"" + drugHistory.charAt(0),wcfmt1));
			sheet.addCell(new Label(4,11,"雌激素",wcfmt1));
			sheet.addCell(new Label(5,11,"" + drugHistory.charAt(1),wcfmt1));
			sheet.addCell(new Label(6,11,"氯米芬",wcfmt1));
			sheet.addCell(new Label(7,11,"" + drugHistory.charAt(2),wcfmt1));
			sheet.addCell(new Label(8,11,"克罗米芬",wcfmt1));
			sheet.addCell(new Label(9,11,"" + drugHistory.charAt(3),wcfmt1));
			sheet.addCell(new Label(10,11,"其他",wcfmt1));
			sheet.mergeCells(11, 11, 13, 11);
			String drugOther = String.valueOf(babyHealth.get("drugOther"));
			if(StringUtils.isBlank(drugOther)||drugOther.equals("null")){
				drugOther = "/";
			}
			sheet.addCell(new Label(11,11,drugOther,wcfmt1));
			
			//第十一行
			sheet.mergeCells(0, 12, 6, 12);
			sheet.addCell(new Label(0,12,"孕期有家庭装修史",wcfmt2));
			sheet.mergeCells(7, 12, 13, 12);
			String yunFitment = String.valueOf(babyHealth.get("yunFitment"));
			if(StringUtils.isBlank(yunFitment)||yunFitment.equals("null")){
				yunFitment = "/";
			}else{
				if("0".equals(yunFitment)){
					yunFitment = "否";
				}else if("1".equals(yunFitment)){
					yunFitment = "是";
				}else{
					yunFitment = "/";
				}
			}
			sheet.addCell(new Label(7,12,yunFitment,wcfmt1));
			
			//第十二行
			sheet.mergeCells(0, 13, 6, 13);
			sheet.addCell(new Label(0,13,"母亲有无视频显示终端暴露（VDTs）",wcfmt2));
			sheet.mergeCells(7, 13, 13, 13);
			String VDTs = String.valueOf(babyHealth.get("VDTs"));
			if(StringUtils.isBlank(VDTs)||VDTs.equals("null")){
				VDTs = "/";
			}else{
				if("0".equals(VDTs)){
					VDTs = "否";
				}else if("1".equals(VDTs)){
					VDTs = "是";
				}else{
					VDTs = "/";
				}
			}
			sheet.addCell(new Label(7,13,VDTs,wcfmt1));
			
			//第十三行
			sheet.mergeCells(0, 14, 1, 14);
			sheet.addCell(new Label(0,14,"母亲饮水",wcfmt2));
			sheet.addCell(new Label(2,14,"自来水",wcfmt1));
			String mumDrink = String.valueOf(babyHealth.get("mumDrink"));
			mumDrink = mumDrink.replace("0", "×");
			mumDrink = mumDrink.replace("1", "√");
			sheet.addCell(new Label(3,14,"" + mumDrink.charAt(0),wcfmt1));
			sheet.addCell(new Label(4,14,"井水",wcfmt1));
			sheet.addCell(new Label(5,14,"" + mumDrink.charAt(1),wcfmt1));
			sheet.addCell(new Label(6,14,"河水",wcfmt1));
			sheet.addCell(new Label(7,14,"" + mumDrink.charAt(2),wcfmt1));
			sheet.mergeCells(8, 14, 13, 14);
			sheet.addCell(new Label(8,14,"",wcfmt1));
			
			//第十四行
			sheet.mergeCells(0, 15, 6, 15);
			sheet.addCell(new Label(0,15,"孕期有无其他化学物质接触史",wcfmt2));
			sheet.mergeCells(7, 15, 13, 15);
			String chemicalContact = String.valueOf(babyHealth.get("chemicalContact"));
			if(StringUtils.isBlank(chemicalContact)||chemicalContact.equals("null")){
				chemicalContact = "/";
			}else{
				if("0".equals(chemicalContact)){
					chemicalContact = "否";
				}else if("1".equals(chemicalContact)){
					chemicalContact = "是";
				}else{
					chemicalContact = "/";
				}
			}
			sheet.addCell(new Label(7,15,chemicalContact,wcfmt1));
			
			//第十五行
			sheet.mergeCells(0, 16, 1, 16);
			sheet.addCell(new Label(0,16,"羊膜检测",wcfmt2));
			sheet.mergeCells(2, 16, 13, 16);
			String amnioscopy = String.valueOf(babyHealth.get("amnioscopy"));
			if(StringUtils.isBlank(amnioscopy)||amnioscopy.equals("null")){
				amnioscopy = "/";
			}else{
				if("0".equals(amnioscopy)){
					amnioscopy = "否";
				}else if("1".equals(amnioscopy)){
					amnioscopy = "是";
				}else{
					amnioscopy = "/";
				}
			}
			sheet.addCell(new Label(2,16,amnioscopy,wcfmt1));
			
			//第十六行
			sheet.mergeCells(0, 17, 1, 17);
			sheet.addCell(new Label(0,17,"羊膜囊穿刺",wcfmt2));
			sheet.mergeCells(2, 17, 13, 17);
			String amniocentesis = String.valueOf(babyHealth.get("amniocentesis"));
			if(StringUtils.isBlank(amniocentesis)||amniocentesis.equals("null")){
				amniocentesis = "/";
			}else{
				if("0".equals(amniocentesis)){
					amniocentesis = "否";
				}else if("1".equals(amniocentesis)){
					amniocentesis = "是";
				}else{
					amniocentesis = "/";
				}
			}
			sheet.addCell(new Label(2,17,amniocentesis,wcfmt1));
			
			//第十七行
			sheet.mergeCells(0, 18, 3, 18);
			sheet.addCell(new Label(0,18,"母亲孕期有无外伤史或是腹部撞击史",wcfmt2));
			sheet.mergeCells(4, 18, 4, 18);
			String hurted = String.valueOf(babyHealth.get("hurted"));
			if(StringUtils.isBlank(hurted)||hurted.equals("null")){
				hurted = "/";
			}else{
				if("0".equals(hurted)){
					hurted = "否";
				}else if("1".equals(hurted)){
					hurted = "是";
				}else{
					hurted = "/";
				}
			}
			sheet.addCell(new Label(4,18,hurted,wcfmt1));
			
			sheet.mergeCells(5, 18, 5, 18);
			sheet.addCell(new Label(5,18,"过敏源",wcfmt2));
			sheet.mergeCells(6, 18, 6, 18);
			String gmy = String.valueOf(babyHealth.get("gmy"));
			if(StringUtils.isBlank(gmy)||gmy.equals("null")){
				gmy = "/";
			}else{
				if("0".equals(gmy)){
					gmy = "否";
				}else if("1".equals(gmy)){
					gmy = "是";
				}else{
					gmy = "/";
				}
			}
			sheet.addCell(new Label(6,18,gmy,wcfmt1));
			
			sheet.mergeCells(7, 18, 8, 18);
			sheet.addCell(new Label(7,18,"具体过敏源",wcfmt2));
			sheet.mergeCells(9, 18, 13, 18);
			String gmyDetail = String.valueOf(babyHealth.get("gmyDetail"));
			if(StringUtils.isBlank(gmyDetail)||gmyDetail.equals("null")){
				gmyDetail = "/";
			}
			sheet.addCell(new Label(9,18,gmyDetail,wcfmt1));
			
			//第十八行
			sheet.mergeCells(0, 19, 1, 19);
			sheet.addCell(new Label(0,19,"血常规",wcfmt2));
			sheet.addCell(new Label(2,19,"血小板"));
			String bloodPlatelet = String.valueOf(babyHealth.get("bloodPlatelet"));
			if(StringUtils.isBlank(bloodPlatelet)||bloodPlatelet.equals("null")){
				bloodPlatelet = "/";
			}else{
				if("0".equals(bloodPlatelet)){
					bloodPlatelet = "正常";
				}else if("1".equals(bloodPlatelet)){
					bloodPlatelet = "下降";
				}else{
					bloodPlatelet = "/";
				}
			}
			sheet.addCell(new Label(3,19,bloodPlatelet,wcfmt1));
			sheet.addCell(new Label(4,19,"血VEGF",wcfmt1));
			sheet.mergeCells(5, 19, 6, 19);
			String VEGF = String.valueOf(babyHealth.get("VEGF"));
			if(StringUtils.isBlank(VEGF)||VEGF.equals("null")){
				VEGF = "/";
			}
			sheet.addCell(new Label(5,19,VEGF,wcfmt1));
			sheet.mergeCells(7, 19, 13, 19);
			sheet.addCell(new Label(7,19,"",wcfmt1));
			
			//第十九 二十行
			sheet.mergeCells(0, 20, 1, 21);
			sheet.addCell(new Label(0, 20, "孕期伴随情况",wcfmt2));
			String yunCase = String.valueOf(babyHealth.get("yunCase"));
			yunCase = yunCase.replace("0", "×");
			yunCase = yunCase.replace("1", "√");
			sheet.addCell(new Label(2, 20, "多胎妊娠",wcfmt1));
			sheet.addCell(new Label(3, 20, ""+yunCase.charAt(0),wcfmt1));
			sheet.addCell(new Label(4, 20, "单卵",wcfmt1));
			sheet.addCell(new Label(5, 20, ""+yunCase.charAt(1),wcfmt1));
			sheet.addCell(new Label(6, 20, "双卵",wcfmt1));
			sheet.addCell(new Label(7, 20, ""+yunCase.charAt(2),wcfmt1));
			sheet.addCell(new Label(8, 20, "先兆子痫",wcfmt1));
			sheet.addCell(new Label(9, 20, ""+yunCase.charAt(3),wcfmt1));
			sheet.addCell(new Label(10, 20, "前置胎盘",wcfmt1));
			sheet.addCell(new Label(11, 20, ""+yunCase.charAt(4),wcfmt1));
			sheet.addCell(new Label(12, 20, "早产",wcfmt1));
			sheet.addCell(new Label(13, 20, ""+yunCase.charAt(5),wcfmt1));
			
			sheet.addCell(new Label(2, 21, "先兆流产",wcfmt1));
			sheet.addCell(new Label(3, 21, ""+yunCase.charAt(6),wcfmt1));
			sheet.addCell(new Label(4, 21, "妊娠高血压",wcfmt1));
			sheet.addCell(new Label(5, 21, ""+yunCase.charAt(7),wcfmt1));
			sheet.addCell(new Label(6, 21, "胎位不正",wcfmt1));
			sheet.addCell(new Label(7, 21, ""+yunCase.charAt(8),wcfmt1));
			sheet.addCell(new Label(8, 21, "糖尿病",wcfmt1));
			sheet.addCell(new Label(9, 21, ""+yunCase.charAt(9)));
			sheet.addCell(new Label(10, 21, "病毒性肝炎",wcfmt1));
			sheet.addCell(new Label(11, 21, ""+yunCase.charAt(10),wcfmt1));
			sheet.mergeCells(12, 21, 13, 21);
			sheet.addCell(new Label(12, 21, "",wcfmt1));
			
			//第二十一行
			sheet.mergeCells(0, 22, 1, 22);
			sheet.addCell(new Label(0, 22, "儿童出生情况",wcfmt2));
			
			sheet.addCell(new Label(2, 22, "出生地",wcfmt1));
			sheet.mergeCells(3, 22, 7, 22);
			String birthPlace = String.valueOf(babyHealth.get("birthPlace"));
			if(StringUtils.isBlank(birthPlace)||birthPlace.equals("null")){
				birthPlace = "/";
			}
			sheet.addCell(new Label(3, 22, birthPlace,wcfmt1));
			
			sheet.addCell(new Label(8, 22, "出生体重",wcfmt1));
			String birthWeight = String.valueOf(babyHealth.get("birthWeight"));
			if(StringUtils.isBlank(birthWeight)||birthWeight.equals("null")){
				birthWeight = "/";
			}
			sheet.addCell(new Label(9, 22, birthWeight,wcfmt1));
			
			sheet.mergeCells(10, 22, 11, 22);
			sheet.addCell(new Label(10, 22, "是否人工助孕",wcfmt1));
			sheet.mergeCells(12, 22, 13, 22);
			String rgYun = String.valueOf(babyHealth.get("rgYun"));
			if(StringUtils.isBlank(rgYun)||rgYun.equals("null")){
				rgYun = "/";
			}else{
				if("0".equals(rgYun)){
					rgYun = "否";
				}else if("1".equals(rgYun)){
					rgYun = "是";
				}else{
					rgYun = "/";
				}
			}
			sheet.addCell(new Label(12, 22, rgYun,wcfmt1));
			
			//第二十二行
			sheet.mergeCells(0, 23, 1, 23);
			sheet.addCell(new Label(0, 23, "儿童健康状况",wcfmt2));
			sheet.mergeCells(2, 23, 13, 23);
			String birthHealth = String.valueOf(babyHealth.get("birthHealth"));
			if(StringUtils.isBlank(birthHealth)||birthHealth.equals("null")){
				birthHealth = "/";
			}
			sheet.addCell(new Label(2, 23, birthHealth,wcfmt1));
			
			//第二十三行
			sheet.mergeCells(0, 24, 9, 24);
			sheet.addCell(new Label(0, 24, "",wcfmt1));
			sheet.mergeCells(10, 24, 11, 24);
			sheet.addCell(new Label(10, 24, "调查医生",wcfmt1));
			sheet.mergeCells(12, 24, 13, 24);
			String doctorName = String.valueOf(babyHealth.get("doctorName"));
			sheet.addCell(new Label(12, 24, doctorName,wcfmt1));
			
			workbook.write(); 
			
		}finally{
			 //关闭Excel工作薄对象   
            workbook.close();  
            //关闭流  
            os.flush();  
            os.close();  
		}
		
		
	}

	/**
	 * 导出复筛报告单
	 * @param response
	 * @param list
	 * @param sheetName
	 * @throws Exception 
	 */
	public static void fcReportToExcel(HttpServletResponse response,
			List<DmcDeviceAlertLifeRoomVo> list, String sheetName) throws Exception {
		
		OutputStream os = null;
		WritableWorkbook workbook = null;
		
		try{
			os = response.getOutputStream();
			workbook = Workbook.createWorkbook(os);
			
			//添加第一个工作表
			WritableSheet sheet = workbook.createSheet(sheetName, 0);
			
//			//第一种画笔
			WritableFont wft = new WritableFont(WritableFont.ARIAL,16,WritableFont.BOLD,false,UnderlineStyle.NO_UNDERLINE,Colour.BLACK);
			WritableCellFormat wcfmt = new WritableCellFormat(wft);
//			wcfmt.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
//			wcfmt.setAlignment(Alignment.CENTRE);
//			wcfmt.setWrap(true);
//
//			//第二种画笔
			WritableFont wft1 = new WritableFont(WritableFont.ARIAL,10,WritableFont.NO_BOLD,false,UnderlineStyle.NO_UNDERLINE,Colour.BLACK);
			WritableCellFormat wcfmt1 = new WritableCellFormat(wft1);
			wcfmt1.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			wcfmt1.setWrap(true);

		//	sheet.addCell(new Label(0,0,"报警信息",wcfmt));
			sheet.addCell(new Label(0,0,"报警id"));
			sheet.addCell(new Label(1,0,"报警状况"));
			sheet.addCell(new Label(2,0,"发生时间"));
			sheet.addCell(new Label(3,0,"确认者"));
			sheet.addCell(new Label(4,0,"确认时间"));

			for (int i = 0; i < list.size(); i++) {
				sheet.addCell(new Label(0,i+1,list.get(i).getAlertId().toString()));
				sheet.addCell(new Label(1,i+1,list.get(i).getAlertType().toString()));
				sheet.addCell(new Label(2,i+1,list.get(i).getCreatedTime().toString()));
				sheet.addCell(new Label(3,i+1,list.get(i).getLastOperator()));
				sheet.addCell(new Label(4,i+1,list.get(i).getUpdateTime().toString()));

			}
//			//写出内容
//			//表头   第零行
//			//合并单元格
 		   // sheet.mergeCells(0, 0, 13, 0);
//			//添加内容

//			//编号行 第一行

//
//			//第二行
//			sheet.mergeCells(0, 2, 1, 2);
//			sheet.addCell(new Label(0,2,"检查单位",wcfmt1));
//			sheet.mergeCells(2, 2, 6, 2);
//			String hospital = String.valueOf(fcReport.get("hospital"));
//			if(StringUtils.isBlank(hospital)||hospital.equals("null")){
//				hospital = "/";
//			}
//			sheet.addCell(new Label(2,2,hospital,wcfmt1));
//
//			sheet.mergeCells(7, 2, 8, 2);
//			sheet.addCell(new Label(7,2,"出生证号码",wcfmt1));
//			sheet.mergeCells(9, 2, 13, 2);
//			String birthNum = String.valueOf(fcReport.get("birthNum"));
//			if(StringUtils.isBlank(birthNum)||birthNum.equals("null")){
//				birthNum = "/";
//			}
//			sheet.addCell(new Label(9,2,birthNum,wcfmt1));
//
//			//第三行
//			sheet.mergeCells(0, 3, 1, 3);
//			sheet.addCell(new Label(0,3,"婴儿姓名",wcfmt1));
//			sheet.mergeCells(2, 3, 6, 3);
//			String patientName = String.valueOf(fcReport.get("patientName"));
//			if(StringUtils.isBlank(patientName)||patientName.equals("null")){
//				patientName = "/";
//			}
//			sheet.addCell(new Label(2,3,patientName,wcfmt1));
//
//			sheet.mergeCells(7, 3, 8, 3);
//			sheet.addCell(new Label(7,3,"性别",wcfmt1));
//			sheet.mergeCells(9, 3, 13, 3);
//			String sex = String.valueOf(fcReport.get("sex"));
//			if(StringUtils.isBlank(sex)||sex.equals("null")){
//				sex = "/";
//			}else{
//				if("0".equals(sex)){
//					sex = "男";
//				}else if("1".equals(sex)){
//					sex = "女";
//				}else{
//					sex = "/";
//				}
//			}
//
//			sheet.addCell(new Label(9,3,sex,wcfmt1));
//
//			//第四行
//			sheet.mergeCells(0, 4, 1, 4);
//			sheet.addCell(new Label(0,4,"出生时间",wcfmt1));
//			sheet.mergeCells(2, 4, 6, 4);
//			String birthday = String.valueOf(fcReport.get("birthday"));
//			String birthTime = String.valueOf(fcReport.get("birthTime"));
//			if(StringUtils.isBlank(birthday)||birthday.equals("null")){
//				birthday = " / 年  / 月  / 日   ";
//			}else{
//				birthday = " " + birthday.substring(0,4) + " 年 "
//						 + " " + birthday.substring(5,7) + " 月  "
//						 + " " + birthday.substring(8,10) + " 日 ";
//			}
//			if(StringUtils.isBlank(birthTime) || birthTime.equals("null")){
//				birthTime = " / 时";
//			}else{
//				birthTime = " " + birthTime + " 时";
//			}
//
//			sheet.addCell(new Label(2,4,(birthday + birthTime) ,wcfmt1));
//
//			sheet.mergeCells(7, 4, 8, 4);
//			sheet.addCell(new Label(7,4,"筛查日期",wcfmt1));
//			sheet.mergeCells(9, 4, 13, 4);
//			String createTime = String.valueOf(fcReport.get("createTime"));
//			if(StringUtils.isBlank(createTime)||createTime.equals("null")){
//				createTime = " / 年  / 月  / 日   ";
//			}else{
//				createTime = " " + createTime.substring(0,4) + " 年 "
//						   + " " + createTime.substring(5,7) + " 月  "
//						   + " " + createTime.substring(8,10) + " 日 ";
//			}
//			String surveyTime = String.valueOf(fcReport.get("surveyTime"));
//			if(StringUtils.isBlank(surveyTime)||surveyTime.equals("null")){
//				surveyTime = " / 时";
//			}else{
//				surveyTime = " " + surveyTime + " 时";
//			}
//			sheet.addCell(new Label(9,4,(createTime + surveyTime),wcfmt1));
//
//			//第五行
//			sheet.mergeCells(0, 5, 1, 5);
//			sheet.addCell(new Label(0,5,"母亲姓名",wcfmt1));
//			String mum = String.valueOf(fcReport.get("motherName"));
//			if(StringUtils.isBlank(mum)||mum.equals("null")){
//				mum = "/";
//			}
//			sheet.addCell(new Label(2,5,mum,wcfmt1));
//
//			sheet.addCell(new Label(3,5,"民族",wcfmt1));
//			String mumNation = String.valueOf(fcReport.get("mumNation"));
//			if(StringUtils.isBlank(mumNation)||mumNation.equals("null")){
//				mumNation = "/";
//			}
//			sheet.addCell(new Label(4,5,mumNation,wcfmt1));
//
//			sheet.addCell(new Label(5,5,"学历",wcfmt1));
//			String mumEducation = String.valueOf(fcReport.get("mumEducation"));
//			if(StringUtils.isBlank(mumEducation)||mumEducation.equals("null")){
//				mumEducation = "/";
//			}
//			sheet.addCell(new Label(6,5,mumEducation,wcfmt1));
//
//			sheet.mergeCells(7, 5, 8, 5);
//			sheet.addCell(new Label(7,5,"联系电话",wcfmt1));
//			sheet.mergeCells(9, 5, 13, 5);
//			String mumTel = String.valueOf(fcReport.get("motherPhone"));
//			if(StringUtils.isBlank(mumTel)||mumTel.equals("null")){
//				mumTel = "/";
//			}
//			sheet.addCell(new Label(9,5,mumTel,wcfmt1));
//
//			//第六行
//			sheet.mergeCells(0, 6, 1, 6);
//			sheet.addCell(new Label(0,6,"父亲姓名",wcfmt1));
//			String dad = String.valueOf(fcReport.get("fatherName"));
//			if(StringUtils.isBlank(dad)||dad.equals("null")){
//				dad = "/";
//			}
//			sheet.addCell(new Label(2,6,dad,wcfmt1));
//
//			sheet.addCell(new Label(3,6,"民族",wcfmt1));
//			String dadNation = String.valueOf(fcReport.get("dadNation"));
//			if(StringUtils.isBlank(dadNation)||dadNation.equals("null")){
//				dadNation = "/";
//			}
//			sheet.addCell(new Label(4,6,dadNation,wcfmt1));
//
//			sheet.addCell(new Label(5,6,"学历",wcfmt1));
//			String dadEducation = String.valueOf(fcReport.get("dadEducation"));
//			if(StringUtils.isBlank(dadEducation)||dadEducation.equals("null")){
//				dadEducation = "/";
//			}
//			sheet.addCell(new Label(6,6,dadEducation,wcfmt1));
//
//			sheet.mergeCells(7, 6, 8, 6);
//			sheet.addCell(new Label(7,6,"联系电话",wcfmt1));
//			sheet.mergeCells(9, 6, 13, 6);
//			String dadTel = String.valueOf(fcReport.get("fatherPhone"));
//			if(StringUtils.isBlank(dadTel)||dadTel.equals("null")){
//				dadTel = "/";
//			}
//			sheet.addCell(new Label(9,6,dadTel,wcfmt1));
//
//			//第七行
//			sheet.mergeCells(0, 7, 1, 7);
//			sheet.addCell(new Label(0,7,"家庭住址",wcfmt1));
//			sheet.mergeCells(2, 7, 6, 7);
//			String address = String.valueOf(fcReport.get("address"));
//			if(StringUtils.isBlank(address)||address.equals("null")){
//				address = "/";
//			}
//			sheet.addCell(new Label(2,7,address,wcfmt1));
//
//			sheet.mergeCells(7, 7, 8, 7);
//			sheet.addCell(new Label(7,7,"户籍",wcfmt1));
//			sheet.mergeCells(9, 7, 13, 7);
//			String register = String.valueOf(fcReport.get("register"));
//			if(StringUtils.isBlank(register)||register.equals("null")){
//				register = "/";
//			}
//			sheet.addCell(new Label(9,7,register,wcfmt1));
//
//			//第八行
//			sheet.mergeCells(0, 8, 1, 8);
//			sheet.addCell(new Label(0,8,"检查方法",wcfmt1));
//			sheet.mergeCells(2, 8, 13, 8);
//			String checkMethod = "" + fcReport.get("checkMethod");
//			String checkMethodStr = "";
//			/*
//			if(StringUtils.isBlank(checkMethod)||checkMethod.equals("null")){
//				checkMethod = "/";
//			};
//			*/
//			if (checkMethod.charAt(0) == '1') {
//				checkMethodStr = "常规检查、B超,";
//			}
//			if (checkMethod.charAt(1) == '1') {
//				checkMethodStr = "血常规,";
//			}
//			if (checkMethod.charAt(2) == '1') {
//				checkMethodStr = "内皮因子,";
//			}
//			if (checkMethod.charAt(3) == '1') {
//				checkMethodStr = "其他";
//			}
//			sheet.addCell(new Label(2,8,checkMethodStr,wcfmt1));
//
//			//第九行
//			sheet.mergeCells(0, 9, 2, 9);
//			sheet.addCell(new Label(0, 9 , "血管瘤或脉管畸形首次发现时间" , wcfmt2));
//			sheet.mergeCells(3, 9, 6, 9);
//			String firstCheck = "" + fcReport.get("firstCheck");
//			if(StringUtils.isBlank(firstCheck)||firstCheck.equals("null")){
//				firstCheck = "/";
//			}
//			sheet.addCell(new Label(3, 9 , firstCheck , wcfmt1));
//
//			sheet.mergeCells(7, 9, 9, 9);
//			sheet.addCell(new Label(7 , 9 , "血管瘤或脉管畸形个数" , wcfmt2));
//			sheet.mergeCells(10, 9, 13, 9);
//			String xmNum = "" + fcReport.get("xmNum");
//			if(StringUtils.isBlank(xmNum)||xmNum.equals("null")){
//				xmNum = "/";
//			}else {
//				if("0".equals(xmNum)){
//					xmNum  = "单个";
//				}else if ("1".equals(xmNum)){
//					xmNum = "多个";
//				}else {
//					xmNum = "/";
//				}
//			}
//			sheet.addCell(new Label(10, 9 , xmNum , wcfmt1));
//
//			//第十行
//			sheet.mergeCells(0, 10, 2, 10);
//			sheet.addCell(new Label(0 , 10 , "血管瘤或脉管畸形增长速度" , wcfmt2));
//			String xmGrow = "" + fcReport.get("xmGrow");
//			if(StringUtils.isBlank(xmGrow)||sex.equals("null")){
//				sex = "/";
//			}else{
//				if("0".equals(xmGrow)){
//					xmGrow = "快速";
//				}else if("1".equals(xmGrow)){
//					xmGrow = "缓慢";
//				}else if("3".equals(xmGrow)){
//					xmGrow = "无变化";
//				}else{
//					xmGrow = "/";
//				}
//			}
//			sheet.addCell(new Label(3, 10, xmGrow , wcfmt1));
//
//			sheet.mergeCells(4, 10, 5, 10);
//			sheet.addCell(new Label(4, 10 ,"是否消退" , wcfmt1));
//			String xmFall = "" + fcReport.get("xmFall");
//			if(StringUtils.isBlank(xmFall) || xmFall.equals("null")){
//				xmFall = "/";
//			}else{
//				if("0".equals(xmFall)){
//					xmFall = "否";
//				}else if("1".equals(xmFall)){
//					xmFall = "是";
//				}else {
//					xmFall = "/";
//				}
//			}
//			sheet.addCell(new Label(6, 10 , xmFall , wcfmt1));
//
//			sheet.mergeCells(7, 10, 8, 10);
//			sheet.addCell(new Label(7 , 10 , "始褪时间" ,wcfmt1));
//			sheet.mergeCells(9, 10, 13, 10);
//			String xmFallTime = "" + fcReport.get("xmFallTime");
//			if(StringUtils.isBlank(xmFallTime)||xmFallTime.equals("null")){
//				xmFallTime = "/";
//			}
//			sheet.addCell(new Label(9, 10 ,xmFallTime ,wcfmt1));
//
//			//第十一行
//			sheet.mergeCells(0, 11, 2, 11);
//			sheet.addCell(new Label(0 ,11 , "血管瘤或脉管畸形发病部位" , wcfmt2));
//			String xmPart = "" + fcReport.get("xmPart");
//			xmPart = xmPart.replace("0", "×");
//			xmPart = xmPart.replace("1", "√");
//
//			sheet.addCell(new Label(3 ,11, "头颈部" ,wcfmt1));
//			sheet.addCell(new Label(4, 11, ""+xmPart.charAt(0),wcfmt1));
//			sheet.addCell(new Label(5, 11, "四肢" , wcfmt1));
//			sheet.addCell(new Label(6, 11, ""+xmPart.charAt(1),wcfmt1));
//			sheet.addCell(new Label(7, 11, "躯干" , wcfmt1));
//			sheet.addCell(new Label(8, 11, ""+xmPart.charAt(2),wcfmt1));
//			sheet.addCell(new Label(9, 11, "内脏" , wcfmt1));
//			sheet.addCell(new Label(10, 11, ""+xmPart.charAt(3),wcfmt1));
//
//			sheet.mergeCells(11, 11, 13, 11);
//			sheet.addCell(new Label(11, 11, "" , wcfmt1));
//
//			//第十二行
//			sheet.mergeCells(0, 12, 2, 12);
//			sheet.addCell(new Label(0 ,12 , "B超显示" , wcfmt2));
//
//			sheet.addCell(new Label(3 ,12, "低回声" ,wcfmt1));
//			String Becho = "" + fcReport.get("Becho");
//			if(StringUtils.isBlank(Becho) || Becho.equals("null")){
//				Becho = "/";
//			}else{
//				if("0".equals(Becho)){
//					Becho = "否";
//				}else if("1".equals(Becho)){
//					Becho = "是";
//				}else {
//					Becho = "/";
//				}
//			}
//			sheet.addCell(new Label(4 , 12 , Becho ,wcfmt1));
//
//			sheet.mergeCells(5, 12, 7, 12);
//			sheet.addCell(new Label(5 , 12 , "明显血流信号" ,wcfmt1));
//
//			String Bblood = "" + fcReport.get("Bblood");
//			if(StringUtils.isBlank(Bblood) || Bblood.equals("null")){
//				Bblood = "/";
//			}else{
//				if("0".equals(Bblood)){
//					Bblood = "否";
//				}else if("1".equals(Bblood)){
//					Bblood = "是";
//				}else {
//					Bblood = "/";
//				}
//			}
//			sheet.addCell(new Label(8 , 12 , Bblood ,wcfmt1));
//
//			sheet.mergeCells(9, 12, 11, 12);
//			sheet.addCell(new Label(9 , 12 , "内脏血管瘤B超显示" ,wcfmt1));
//
//			sheet.mergeCells(12, 12, 13, 12);
//			String Borgan = "" + fcReport.get("Borgan");
//			if(StringUtils.isBlank(Borgan) || Borgan.equals("null")){
//				Borgan = "/";
//			}else{
//				if("0".equals(Borgan)){
//					Borgan = "否";
//				}else if("1".equals(Borgan)){
//					Borgan = "是";
//				}else {
//					Borgan = "/";
//				}
//			}
//			sheet.addCell(new Label(12 , 12 , Borgan ,wcfmt1));
//
//			//第十三行
//			sheet.mergeCells(0, 13, 2, 13);
//			sheet.addCell(new Label(0 ,13 , "血管瘤或脉管畸形大小" , wcfmt2));
//			sheet.mergeCells(3, 13, 13, 13);
//
//			String xmShape = "" + fcReport.get("xmShape");
//			String xmSize = "" + fcReport.get("xmSize");
//			if(StringUtils.isNotBlank(xmShape)&&!xmShape.equals("null")){
//				if("0".equals(xmShape)){
//					xmShape = "小红点";
//				}else if("1".equals(xmShape)){
//					xmShape = "绿豆大小";
//				}else if("2".equals(xmShape)){
//					xmShape = "硬币大小";
//				}else if("3".equals(xmShape)){
//					xmShape = "鸡蛋大小";
//				}
//				sheet.addCell(new Label(3 ,13 , xmShape , wcfmt1));
//			}else if(StringUtils.isNotBlank(xmSize)&&!xmSize.equals("null")){
//
//				if("0".equals(xmSize)){
//					xmSize = "<1cm";
//				}else if("1".equals(xmSize)){
//					xmSize = ">1cm";
//				}else if("2".equals(xmSize)){
//					xmSize = ">3cm";
//				}else if("3".equals(xmSize)){
//					xmSize = ">5cm";
//				}else if("4".equals(xmSize)){
//					xmSize = ">10cm";
//				}
//				sheet.addCell(new Label(3 ,13 , xmSize , wcfmt1));
//			}
//
//			//第十四、十五行
//			sheet.mergeCells(0, 14, 2, 15);
//			sheet.addCell(new Label(0 ,14 , "血管瘤或脉管畸形肤色" , wcfmt2));
//
//			String xmColor = "" + fcReport.get("xmColor");
//			xmColor = xmColor.replace("0", "×");
//			xmColor = xmColor.replace("1", "√");
//
//			sheet.addCell(new Label(3 ,14 , "肤色" , wcfmt1));
//			sheet.addCell(new Label(4 ,14 , "" + xmColor.charAt(0) , wcfmt1));
//			sheet.addCell(new Label(5 ,14 , "红色" , wcfmt1));
//			sheet.addCell(new Label(6 ,14 , "" + xmColor.charAt(1) , wcfmt1));
//			sheet.addCell(new Label(7 ,14 , "暗紫红色" , wcfmt1));
//			sheet.addCell(new Label(8 ,14 , "" + xmColor.charAt(2) , wcfmt1));
//			sheet.addCell(new Label(9 ,14 , "蓝色" , wcfmt1));
//			sheet.addCell(new Label(10 ,14 , "" + xmColor.charAt(3) , wcfmt1));
//			sheet.addCell(new Label(11 ,14 , "青色" , wcfmt1));
//			sheet.addCell(new Label(12 ,14 , "" + xmColor.charAt(4) , wcfmt1));
//			sheet.addCell(new Label(13 ,14 , "" , wcfmt1));
//
//			sheet.addCell(new Label(3 ,15 , "黑色" , wcfmt1));
//			sheet.addCell(new Label(4 ,15 , "" + xmColor.charAt(5) , wcfmt1));
//			sheet.addCell(new Label(5 ,15 , "褐色" , wcfmt1));
//			sheet.addCell(new Label(6 ,15 , "" + xmColor.charAt(6) , wcfmt1));
//			sheet.addCell(new Label(7 ,15 , "粉红色" , wcfmt1));
//			sheet.addCell(new Label(8 ,15 , "" + xmColor.charAt(7) , wcfmt1));
//			sheet.addCell(new Label(9 ,15 , "浅红色" , wcfmt1));
//			sheet.addCell(new Label(10 ,15 , "" + xmColor.charAt(8) , wcfmt1));
//
//			sheet.mergeCells(11, 15, 13, 15);
//			sheet.addCell(new Label(11 ,15 , "" , wcfmt1));
//
//			//第十六行
//			sheet.mergeCells(0, 16, 2, 16);
//			sheet.addCell(new Label(0 , 16 , "皮肤局部有无突起" , wcfmt2));
//			sheet.mergeCells(3, 16, 6, 16);
//			String skinRaised = "" + fcReport.get("skinRaised");
//			if(StringUtils.isBlank(skinRaised) || skinRaised.equals("null")){
//				skinRaised = "/";
//			}else{
//				if("0".equals(skinRaised)){
//					skinRaised = "否";
//				}else if("1".equals(skinRaised)){
//					skinRaised = "是";
//				}else {
//					skinRaised = "/";
//				}
//			}
//			sheet.addCell(new Label(3 , 16 , skinRaised ,wcfmt1));
//
//			sheet.mergeCells(7, 16, 9, 16);
//			sheet.addCell(new Label(7 , 16 , "病变处特征（质地）" , wcfmt2));
//			sheet.mergeCells(10, 16, 13, 16);
//			String disease = "" + fcReport.get("disease");
//			if(StringUtils.isBlank(disease) || disease.equals("null")){
//				disease = "/";
//			}else{
//				if("0".equals(disease)){
//					disease = "柔软";
//				}else if("1".equals(disease)){
//					disease = "较硬";
//				}else {
//					disease = "/";
//				}
//			}
//			sheet.addCell(new Label(10 , 16 , disease ,wcfmt1));
//
//			//第十七行
//			sheet.mergeCells(0, 17, 6, 17);
//			sheet.addCell(new Label(0,17,"家族血亲三代有无血管瘤或脉管畸形病史",wcfmt2));
//			sheet.mergeCells(7, 17, 13, 17);
//			String jzsxm = String.valueOf(fcReport.get("jzsxm"));
//			if(StringUtils.isBlank(jzsxm)||jzsxm.equals("null")){
//				jzsxm = "/";
//			}else{
//				if("0".equals(jzsxm)){
//					jzsxm = "否";
//				}else if("1".equals(jzsxm)){
//					jzsxm = "是";
//				}else{
//					jzsxm = "/";
//				}
//			}
//			sheet.addCell(new Label(7,17,jzsxm,wcfmt1));
//
//			//第十八行
//			sheet.mergeCells(0, 18, 6, 18);
//			sheet.addCell(new Label(0,18,"兄弟姐妹有无血管瘤或脉管畸形病史",wcfmt2));
//			sheet.mergeCells(7, 18, 13, 18);
//			String xdjmxm = String.valueOf(fcReport.get("xdjmxm"));
//			if(StringUtils.isBlank(xdjmxm)||xdjmxm.equals("null")){
//				xdjmxm = "/";
//			}else{
//				if("0".equals(xdjmxm)){
//					xdjmxm = "否";
//				}else if("1".equals(xdjmxm)){
//					xdjmxm = "是";
//				}else{
//					xdjmxm = "/";
//				}
//			}
//			sheet.addCell(new Label(7,18,xdjmxm,wcfmt1));
//
//			//第十九行
//			sheet.mergeCells(0, 19, 1, 19);
//			sheet.addCell(new Label(0,19,"孕产史",wcfmt2));
//			String yunChan = String.valueOf(fcReport.get("yunChan"));
//			if(StringUtils.isBlank(yunChan)||yunChan.equals("null")){
//				yunChan = "/";
//			}else{
//				if("0".equals(yunChan)){
//					yunChan = "否";
//				}else if("1".equals(yunChan)){
//					yunChan = "是";
//				}else{
//					yunChan = "/";
//				}
//			}
//			sheet.addCell(new Label(2,19,yunChan,wcfmt1));
//
//			sheet.addCell(new Label(3,19,"孕"));
//			String yunNum = String.valueOf(fcReport.get("yunNum"));
//			if(StringUtils.isBlank(yunNum)||yunNum.equals("null")){
//				yunNum = "/";
//			}
//			sheet.addCell(new Label(4,19,yunNum + " 次",wcfmt1));
//
//			sheet.addCell(new Label(5,19,"产"));
//			String chanNum = String.valueOf(fcReport.get("chanNum"));
//			if(StringUtils.isBlank(chanNum)||chanNum.equals("null")){
//				chanNum = "/";
//			}
//			sheet.addCell(new Label(6,19,chanNum + " 胎",wcfmt1));
//
//			sheet.mergeCells(7, 19, 8, 19);
//			sheet.addCell(new Label(7,19,"此孩怀孕年龄",wcfmt1));
//			sheet.mergeCells(9, 19, 13, 19);
//			String yunAge = String.valueOf(fcReport.get("yunAge"));
//			if(StringUtils.isBlank(yunAge)||yunAge.equals("null")){
//				yunAge = "/";
//			}
//			sheet.addCell(new Label(9,19,yunAge,wcfmt1));
//
//			//第二十行
//			sheet.mergeCells(0, 20, 1, 20);
//			sheet.addCell(new Label(0,20,"孕期药物治疗史",wcfmt2));
//			sheet.addCell(new Label(2,20,"黄体酮",wcfmt1));
//			String drugHistory = String.valueOf(fcReport.get("drugHistory"));
//			drugHistory = drugHistory.replace("0", "×");
//			drugHistory = drugHistory.replace("1", "√");
//
//			sheet.addCell(new Label(3,20,"" + drugHistory.charAt(0),wcfmt1));
//			sheet.addCell(new Label(4,20,"雌激素",wcfmt1));
//			sheet.addCell(new Label(5,20,"" + drugHistory.charAt(1),wcfmt1));
//			sheet.addCell(new Label(6,20,"氯米芬",wcfmt1));
//			sheet.addCell(new Label(7,20,"" + drugHistory.charAt(2),wcfmt1));
//			sheet.addCell(new Label(8,20,"克罗米芬",wcfmt1));
//			sheet.addCell(new Label(9,20,"" + drugHistory.charAt(3),wcfmt1));
//			sheet.addCell(new Label(10,20,"其他",wcfmt1));
//			sheet.mergeCells(11, 20, 13, 20);
//			String drugOther = String.valueOf(fcReport.get("drugOther"));
//			if(StringUtils.isBlank(drugOther)||drugOther.equals("null")){
//				drugOther = "/";
//			}
//			sheet.addCell(new Label(11,20,drugOther,wcfmt1));
//
//			//第二十一行
//			sheet.mergeCells(0, 21, 6, 21);
//			sheet.addCell(new Label(0,21,"孕期有家庭装修史",wcfmt2));
//			sheet.mergeCells(7, 21, 13, 21);
//			String yunFitment = String.valueOf(fcReport.get("yunFitment"));
//			if(StringUtils.isBlank(yunFitment)||yunFitment.equals("null")){
//				yunFitment = "/";
//			}else{
//				if("0".equals(yunFitment)){
//					yunFitment = "否";
//				}else if("1".equals(yunFitment)){
//					yunFitment = "是";
//				}else{
//					yunFitment = "/";
//				}
//			}
//			sheet.addCell(new Label(7,21,yunFitment,wcfmt1));
//
//			//第二十二行
//			sheet.mergeCells(0, 22, 6, 22);
//			sheet.addCell(new Label(0,22,"母亲有无视频显示终端暴露（VDTs）",wcfmt2));
//			sheet.mergeCells(7, 22, 13, 22);
//			String VDTs = String.valueOf(fcReport.get("VDTs"));
//			if(StringUtils.isBlank(VDTs)||VDTs.equals("null")){
//				VDTs = "/";
//			}else{
//				if("0".equals(VDTs)){
//					VDTs = "否";
//				}else if("1".equals(VDTs)){
//					VDTs = "是";
//				}else{
//					VDTs = "/";
//				}
//			}
//			sheet.addCell(new Label(7,22,VDTs,wcfmt1));
//
//			//第二十三行
//			sheet.mergeCells(0, 23, 1, 23);
//			sheet.addCell(new Label(0,23,"母亲饮水",wcfmt2));
//			sheet.addCell(new Label(2,23,"自来水",wcfmt1));
//			String mumDrink = String.valueOf(fcReport.get("mumDrink"));
//			mumDrink = mumDrink.replace("0", "×");
//			mumDrink = mumDrink.replace("1", "√");
//			sheet.addCell(new Label(3,23,"" + mumDrink.charAt(0),wcfmt1));
//			sheet.addCell(new Label(4,23,"井水",wcfmt1));
//			sheet.addCell(new Label(5,23,"" + mumDrink.charAt(1),wcfmt1));
//			sheet.addCell(new Label(6,23,"河水",wcfmt1));
//			sheet.addCell(new Label(7,23,"" + mumDrink.charAt(2),wcfmt1));
//			sheet.mergeCells(8, 23, 13, 23);
//			sheet.addCell(new Label(8,23,"",wcfmt1));
//
//			//第二十四行
//			sheet.mergeCells(0, 24, 6, 24);
//			sheet.addCell(new Label(0,24,"孕期有无其他化学物质接触史",wcfmt2));
//			sheet.mergeCells(7, 24, 13, 24);
//			String chemicalContact = String.valueOf(fcReport.get("chemicalContact"));
//			if(StringUtils.isBlank(chemicalContact)||chemicalContact.equals("null")){
//				chemicalContact = "/";
//			}else{
//				if("0".equals(chemicalContact)){
//					chemicalContact = "否";
//				}else if("1".equals(chemicalContact)){
//					chemicalContact = "是";
//				}else{
//					chemicalContact = "/";
//				}
//			}
//			sheet.addCell(new Label(7,24,chemicalContact,wcfmt1));
//
//			//第二十五行
//			sheet.mergeCells(0, 25, 1, 25);
//			sheet.addCell(new Label(0,25,"羊膜检测",wcfmt2));
//			sheet.mergeCells(2, 25, 13, 25);
//			String amnioscopy = String.valueOf(fcReport.get("amnioscopy"));
//			if(StringUtils.isBlank(amnioscopy)||amnioscopy.equals("null")){
//				amnioscopy = "/";
//			}else{
//				if("0".equals(amnioscopy)){
//					amnioscopy = "否";
//				}else if("1".equals(amnioscopy)){
//					amnioscopy = "是";
//				}else{
//					amnioscopy = "/";
//				}
//			}
//			sheet.addCell(new Label(2,25,amnioscopy,wcfmt1));
//
//			//第二十六行
//			sheet.mergeCells(0, 26, 1, 26);
//			sheet.addCell(new Label(0,26,"羊膜囊穿刺",wcfmt2));
//			sheet.mergeCells(2, 26, 13, 26);
//			String amniocentesis = String.valueOf(fcReport.get("amniocentesis"));
//			if(StringUtils.isBlank(amniocentesis)||amniocentesis.equals("null")){
//				amniocentesis = "/";
//			}else{
//				if("0".equals(amniocentesis)){
//					amniocentesis = "否";
//				}else if("1".equals(amniocentesis)){
//					amniocentesis = "是";
//				}else{
//					amniocentesis = "/";
//				}
//			}
//			sheet.addCell(new Label(2,26,amniocentesis,wcfmt1));
//
//			//第二十七行
//			sheet.mergeCells(0, 27, 6, 27);
//			sheet.addCell(new Label(0,27,"母亲孕期有无外伤史或是腹部撞击史",wcfmt2));
//			sheet.mergeCells(7, 27, 13, 27);
//			String hurted = String.valueOf(fcReport.get("hurted"));
//			if(StringUtils.isBlank(hurted)||hurted.equals("null")){
//				hurted = "/";
//			}else{
//				if("0".equals(hurted)){
//					hurted = "否";
//				}else if("1".equals(hurted)){
//					hurted = "是";
//				}else{
//					hurted = "/";
//				}
//			}
//			sheet.addCell(new Label(7,27,hurted,wcfmt1));
//
//			//第二十八行
//			sheet.mergeCells(0, 28, 1, 28);
//			sheet.addCell(new Label(0, 28 ,"过敏原",wcfmt2));
//			//是否有过敏原
//			String gmy = "" + fcReport.get("gmy");
//			if(StringUtils.isBlank(gmy)||gmy.equals("null")){
//				gmy = "/";
//			}else{
//				if("0".equals(gmy)){
//					gmy = "否";
//				}else if("1".equals(gmy)){
//					gmy = "是";
//				}else{
//					gmy = "/";
//				}
//			}
//			sheet.addCell(new Label(2,28,gmy,wcfmt1));
//
//			sheet.mergeCells(3, 28, 4, 28);
//			sheet.addCell(new Label(3, 28 , "具体过敏原" , wcfmt1));
//			sheet.mergeCells(5, 28, 13, 28);
//			String gmyDetail = "" + fcReport.get("gmyDetail");
//			if(StringUtils.isBlank(gmyDetail)||"null".equals(gmyDetail)){
//				gmyDetail = "/";
//			}
//			sheet.addCell(new Label(5,28,gmyDetail,wcfmt1));
//
//			//第二十九、三十行
//			sheet.mergeCells(0, 29, 1, 30);
//			sheet.addCell(new Label(0,29,"血管瘤治疗情况",wcfmt2));
//			sheet.addCell(new Label(2,29,"口服药物",wcfmt1));
//			sheet.mergeCells(3, 29, 13, 29);
//			String cureDrug = "" + fcReport.get("cureDrug");
//			if(StringUtils.isBlank(cureDrug) || cureDrug.equals("null")){
//				cureDrug = "/";
//			}
//			sheet.addCell(new Label(3, 29, cureDrug, wcfmt1));
//
//			sheet.addCell(new Label(2,30,"其他药物",wcfmt1));
//			sheet.mergeCells(3, 30, 13, 30);
//			String cureOther = "" + fcReport.get("cureOther");
//			if(StringUtils.isBlank(cureOther) || cureOther.equals("null")){
//				cureOther = "/";
//			}
//
//			sheet.addCell(new Label(3, 30, cureOther, wcfmt1));
//
//			//第三十一、三十二行
//			sheet.mergeCells(0, 31, 1, 32);
//			sheet.addCell(new Label(0, 31, "孕期伴随情况",wcfmt2));
//			String yunCase = String.valueOf(fcReport.get("yunCase"));
//			yunCase = yunCase.replace("0", "×");
//			yunCase = yunCase.replace("1", "√");
//			sheet.addCell(new Label(2, 31, "多胎妊娠",wcfmt1));
//			sheet.addCell(new Label(3, 31, ""+yunCase.charAt(0),wcfmt1));
//			sheet.addCell(new Label(4, 31, "单卵",wcfmt1));
//			sheet.addCell(new Label(5, 31, ""+yunCase.charAt(1),wcfmt1));
//			sheet.addCell(new Label(6, 31, "双卵",wcfmt1));
//			sheet.addCell(new Label(7, 31, ""+yunCase.charAt(2),wcfmt1));
//			sheet.addCell(new Label(8, 31, "先兆子痫",wcfmt1));
//			sheet.addCell(new Label(9, 31, ""+yunCase.charAt(3),wcfmt1));
//			sheet.addCell(new Label(10, 31, "前置胎盘",wcfmt1));
//			sheet.addCell(new Label(11, 31, ""+yunCase.charAt(4),wcfmt1));
//			sheet.addCell(new Label(12, 31, "早产",wcfmt1));
//			sheet.addCell(new Label(13, 31, ""+yunCase.charAt(5),wcfmt1));
//
//			sheet.addCell(new Label(2, 32, "先兆流产",wcfmt1));
//			sheet.addCell(new Label(3, 32, ""+yunCase.charAt(6),wcfmt1));
//			sheet.addCell(new Label(4, 32, "妊娠高血压",wcfmt1));
//			sheet.addCell(new Label(5, 32, ""+yunCase.charAt(7),wcfmt1));
//			sheet.addCell(new Label(6, 32, "胎位不正",wcfmt1));
//			sheet.addCell(new Label(7, 32, ""+yunCase.charAt(8),wcfmt1));
//			sheet.addCell(new Label(8, 32, "糖尿病",wcfmt1));
//			sheet.addCell(new Label(9, 32, ""+yunCase.charAt(9)));
//			sheet.addCell(new Label(10, 32, "病毒性肝炎",wcfmt1));
//			sheet.addCell(new Label(11, 32, ""+yunCase.charAt(10),wcfmt1));
//			sheet.mergeCells(12, 32, 13, 32);
//			sheet.addCell(new Label(12, 32, "",wcfmt1));
//
//			//第三十三行
//			sheet.mergeCells(0, 33, 1, 33);
//			sheet.addCell(new Label(0, 33, "儿童出生情况",wcfmt2));
//
//			sheet.addCell(new Label(2, 33, "出生地",wcfmt1));
//			sheet.mergeCells(3, 33, 7, 33);
//			String birthPlace = String.valueOf(fcReport.get("birthPlace"));
//			if(StringUtils.isBlank(birthPlace)||birthPlace.equals("null")){
//				birthPlace = "/";
//			}
//			sheet.addCell(new Label(3, 33, birthPlace,wcfmt1));
//
//			sheet.addCell(new Label(8, 33, "出生体重",wcfmt1));
//			String birthWeight = String.valueOf(fcReport.get("birthWeight"));
//			if(StringUtils.isBlank(birthWeight)||birthWeight.equals("null")){
//				birthWeight = "/";
//			}
//			sheet.addCell(new Label(9, 33, birthWeight,wcfmt1));
//
//			sheet.mergeCells(10, 33, 11, 33);
//			sheet.addCell(new Label(10, 33, "是否人工助孕",wcfmt1));
//			sheet.mergeCells(12, 33, 13, 33);
//			String rgYun = String.valueOf(fcReport.get("rgYun"));
//			if(StringUtils.isBlank(rgYun)||rgYun.equals("null")){
//				rgYun = "/";
//			}else{
//				if("0".equals(rgYun)){
//					rgYun = "否";
//				}else if("1".equals(rgYun)){
//					rgYun = "是";
//				}else{
//					rgYun = "/";
//				}
//			}
//			sheet.addCell(new Label(12, 33, rgYun,wcfmt1));
//
//			//第三十四行
//			sheet.mergeCells(0, 34, 1, 34);
//			sheet.addCell(new Label(0, 34, "复筛节点",wcfmt2));
//			sheet.mergeCells(2, 34, 13, 34);
//			String fcNodes =  "" + fcReport.get("fcNodes");
//			if(StringUtils.isBlank(fcNodes)||fcNodes.equals("null")){
//				fcNodes = "/";
//			}else{
//				if("0".equals(fcNodes)){
//					fcNodes = "刚出生";
//				}else if("1".equals(fcNodes)){
//					fcNodes = "生产后42天";
//				}else if("2".equals(fcNodes)){
//					fcNodes = "3个月";
//				}else if("3".equals(fcNodes)){
//					fcNodes = "6个月";
//				}else if("4".equals(fcNodes)){
//					fcNodes = "1岁";
//				} else if("5".equals(fcNodes)) {
//					fcNodes = "1-6岁";
//				}else{
//					fcNodes = "/";
//				}
//			}
//			sheet.addCell(new Label(2, 34, fcNodes,wcfmt1));
//
//			//第三十五、三十六、三十七行
//			sheet.mergeCells(0, 35, 3, 37);
//			sheet.addCell(new Label(0, 35, "血管瘤并发疾病及血管瘤合并疾病",wcfmt2));
//			String xmCase = "" + fcReport.get("xmCase");
//			xmCase = xmCase.replace("0", "×");
//			xmCase = xmCase.replace("1", "√");
//
//			sheet.addCell(new Label(4, 35, "溃疡", wcfmt1));
//			sheet.addCell(new Label(5, 35 , "" +xmCase.charAt(0) , wcfmt1));
//			sheet.addCell(new Label(6, 35, "出血", wcfmt1));
//			sheet.addCell(new Label(7, 35 , "" +xmCase.charAt(1) , wcfmt1));
//			sheet.addCell(new Label(8, 35, "睡眠打鼾", wcfmt1));
//			sheet.addCell(new Label(9, 35 , "" +xmCase.charAt(2) , wcfmt1));
//			sheet.addCell(new Label(10, 35, "呼吸困难", wcfmt1));
//			sheet.addCell(new Label(11, 35 , "" +xmCase.charAt(3) , wcfmt1));
//			sheet.addCell(new Label(12, 35, "吞咽障碍", wcfmt1));
//			sheet.addCell(new Label(13, 35 , "" +xmCase.charAt(4) , wcfmt1));
//
//			sheet.mergeCells(4, 36, 6, 36);
//			sheet.addCell(new Label(4, 36, "眼部病变影响视力", wcfmt1));
//			sheet.addCell(new Label(7, 36 , "" +xmCase.charAt(5) , wcfmt1));
//			sheet.addCell(new Label(8, 36, "心衰", wcfmt1));
//			sheet.addCell(new Label(9, 36 , "" +xmCase.charAt(6) , wcfmt1));
//			sheet.addCell(new Label(10, 36, "脑部病变", wcfmt1));
//			sheet.addCell(new Label(11, 36 , "" +xmCase.charAt(7) , wcfmt1));
//			sheet.addCell(new Label(12, 36, "其他", wcfmt1));
//			sheet.addCell(new Label(13, 36 , "" +xmCase.charAt(8) , wcfmt1));
//
//			sheet.addCell(new Label(4, 37, "暂无", wcfmt1));
//			sheet.addCell(new Label(5, 37 , "" +xmCase.charAt(9) , wcfmt1));
//			sheet.mergeCells(6, 37, 13, 37);
//			sheet.addCell(new Label(6, 37, "", wcfmt1));
//
//			//第三十八行
//			sheet.mergeCells(0, 38, 1, 38);
//			sheet.addCell(new Label(0,38,"血常规",wcfmt2));
//			sheet.addCell(new Label(2,38,"血小板"));
//			String bloodPlatelet = String.valueOf(fcReport.get("bloodPlatelet"));
//			if(StringUtils.isBlank(bloodPlatelet)||bloodPlatelet.equals("null")){
//				bloodPlatelet = "/";
//			}else{
//				if("0".equals(bloodPlatelet)){
//					bloodPlatelet = "正常";
//				}else if("1".equals(bloodPlatelet)){
//					bloodPlatelet = "下降";
//				}else{
//					bloodPlatelet = "/";
//				}
//			}
//			sheet.addCell(new Label(3,38,bloodPlatelet,wcfmt1));
//
//			sheet.addCell(new Label(4,38,"血VEGF",wcfmt1));
//			sheet.mergeCells(5, 38, 6, 38);
//			String VEGF = String.valueOf(fcReport.get("VEGF"));
//			if(StringUtils.isBlank(VEGF)||VEGF.equals("null")){
//				VEGF = "/";
//			}
//			sheet.addCell(new Label(5,38,VEGF,wcfmt1));
//			sheet.mergeCells(7, 38, 13, 38);
//			sheet.addCell(new Label(7,38,"",wcfmt1));
//
//			//第三十九行
//			sheet.mergeCells(0, 39, 1, 39);
//			sheet.addCell(new Label(0,39,"初步诊断",wcfmt2));
//			sheet.mergeCells(2, 39, 6, 39);
//			String Pdiagnose = "" + fcReport.get("Pdiagnose");
//			if(StringUtils.isBlank(Pdiagnose)||Pdiagnose.equals("null")){
//				Pdiagnose = "/";
//			}else{
//				/*
//				if("0".equals(Pdiagnose)){
//					Pdiagnose = "真性血管瘤";
//				}else if("1".equals(Pdiagnose)){
//					Pdiagnose = "血管畸形";
//				}else if("2".equals(Pdiagnose)){
//					Pdiagnose = "淋巴管畸形";
//				}else if("3".equals(Pdiagnose)){
//					Pdiagnose = "脉管畸形";
//				}else if("4".equals(Pdiagnose)){
//					Pdiagnose = "其他色素痣";
//				}else{
//					Pdiagnose = "/";
//				}
//				*/
//				if("0".equals(Pdiagnose)){
//					Pdiagnose = "真性血管瘤";
//				}else if("1".equals(Pdiagnose)){
//					Pdiagnose = "微静脉畸形";
//				}else if("2".equals(Pdiagnose)){
//					Pdiagnose = "淋巴管畸形";
//				}else if("3".equals(Pdiagnose)){
//					Pdiagnose = "其他脉管畸形";
//				}else if("4".equals(Pdiagnose)){
//					Pdiagnose = "其他";
//				}else if("5".equals(Pdiagnose)){
//					Pdiagnose = "动静脉畸形";
//				}else if("6".equals(Pdiagnose)){
//					Pdiagnose = "静脉畸形";
//				}else{
//					Pdiagnose = "/";
//				}
//			}
//			sheet.addCell(new Label(2, 39 ,Pdiagnose, wcfmt1));
//
//			sheet.mergeCells(7, 39, 8, 39);
//			sheet.addCell(new Label(7,39,"血管瘤类型",wcfmt2));
//			sheet.mergeCells(9, 39, 13, 39);
//			String xmType = "" + fcReport.get("xmType");
//			if(StringUtils.isBlank(xmType)||xmType.equals("null")){
//				xmType = "/";
//			}else{
//				if("0".equals(xmType)){
//					xmType = "表浅型";
//				}else if("1".equals(xmType)){
//					xmType = "深部型";
//				}else if("2".equals(xmType)){
//					xmType = "深浅混合型";
//				}else if("3".equals(xmType)){
//					xmType = "脉管畸形";
//				}else{
//					xmType = "/";
//				}
//			}
//			sheet.addCell(new Label(9, 39 ,xmType, wcfmt1));
//
//			//第四十、四十一行
//			sheet.mergeCells(0, 40, 1, 41);
//			sheet.addCell(new Label(0,40,"医生意见",wcfmt2));
//			String advice = "" + fcReport.get("advice");
//			if(StringUtils.isBlank(advice)||advice.equals("null")){
//				advice = "/";
//			}
//			sheet.mergeCells(2, 40, 13, 41);
//			sheet.addCell(new Label(2,40,advice,wcfmt1));
//
//			//第四十二行
//			sheet.mergeCells(0, 42, 1, 42);
//			sheet.addCell(new Label(0,42,"报告时间",wcfmt2));
//			sheet.mergeCells(2, 42, 13, 42);
//			sheet.addCell(new Label(2,42,createTime,wcfmt1));
//
//			//第四十三行
//			sheet.mergeCells(0, 43, 9, 43);
//			sheet.addCell(new Label(0, 43, "",wcfmt1));
//			sheet.mergeCells(10, 43, 11, 43);
//			sheet.addCell(new Label(10, 43, "复筛医生签名",wcfmt1));
//			sheet.mergeCells(12, 43, 13, 43);
//			String doctorName = String.valueOf(fcReport.get("doctorName"));
//			sheet.addCell(new Label(12, 43, doctorName,wcfmt1));
			
			workbook.write(); 
			

		}finally{
			//关闭Excel工作薄对象   
            workbook.close();  
            //关闭流  
            os.flush();  
            os.close();  
		}
		
	}


	public static void test(HttpServletResponse response, List<DmcDeviceAlertLifeRoomVo> dmcDeviceAlertLifeRoomVoList, String titleName, String sheetName, List<String> columns) throws IOException, WriteException {

		OutputStream os = null;
		WritableWorkbook workbook = null;

		try {

			os = response.getOutputStream();
			workbook = Workbook.createWorkbook(os);

			WritableSheet sheet = workbook.createSheet(sheetName, 0);

			//创建画笔
			//第一种画笔
			WritableFont wft = new WritableFont(WritableFont.ARIAL,20,WritableFont.BOLD,false,UnderlineStyle.NO_UNDERLINE,Colour.BLACK);
			WritableCellFormat wcfmt = new WritableCellFormat(wft);
			wcfmt.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			//设置水平居中
			wcfmt.setAlignment(Alignment.CENTRE);
			//设置垂直居中
			wcfmt.setVerticalAlignment(VerticalAlignment.CENTRE);
			wcfmt.setWrap(true);

			//第二种画笔
			WritableFont wft1 = new WritableFont(WritableFont.ARIAL,10,WritableFont.NO_BOLD,false,UnderlineStyle.NO_UNDERLINE,Colour.BLACK);
			WritableCellFormat wcfmt1 = new WritableCellFormat(wft1);
			wcfmt1.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			wcfmt1.setAlignment(Alignment.CENTRE);

			//第三种画笔
			WritableFont wft2 = new WritableFont(WritableFont.ARIAL,12,WritableFont.BOLD,false,UnderlineStyle.NO_UNDERLINE,Colour.BLACK);
			WritableCellFormat wcfmt2 = new WritableCellFormat(wft2);
			wcfmt2.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			//设置水平居中
			wcfmt2.setAlignment(Alignment.CENTRE);
			//设置垂直居中
			wcfmt2.setVerticalAlignment(VerticalAlignment.CENTRE);
			wcfmt2.setWrap(true);

			//设置列宽
			sheet.setColumnView(0, 15);
			sheet.setColumnView(1, 30);
			sheet.setColumnView(2, 30);
			sheet.setColumnView(3, 15);
			sheet.setColumnView(4, 30);

			//写入表头
			sheet.mergeCells(0, 0, columns.size()-1, 0);
			sheet.addCell(new Label(0, 0, titleName, wcfmt));
			sheet.setRowView(0, 1000);

			//循环写入
			for(int i = 0 ; i< columns.size(); i ++ ){
				sheet.addCell(new Label (i,1,columns.get(i), wcfmt2));
			}
			sheet.setRowView(1, 450);

			int i = 0;
			for (DmcDeviceAlertLifeRoomVo dalrv : dmcDeviceAlertLifeRoomVoList) {

				sheet.addCell(new Label(0 , i + 2 , dalrv.getAlertId() + "",  wcfmt1));
				sheet.addCell(new Label(1 , i + 2 , dalrv.getAlertTypeString()+ "",  wcfmt1));
				sheet.addCell(new Label(2 , i + 2 , dalrv.getCreatedTime() + "",  wcfmt1));
				sheet.addCell(new Label(3 , i + 2 , dalrv.getLastOperator() + "",  wcfmt1));
				sheet.addCell(new Label(4 , i + 2 , dalrv.getUpdateTime() + "",  wcfmt1));

				i = i + 1;
			}

			workbook.write();
		} catch (RowsExceededException e) {
			e.printStackTrace();
		} catch (WriteException e) {
			e.printStackTrace();
		} finally {
			workbook.close();
			os.flush();
			os.close();
		}
	}
	
	public static void babyHealthAllToExcel(HttpServletResponse response,
			List<Map<String, Object>> reportList, String sheetName,
			List<String> columns, String code) throws Exception {
		
		OutputStream os = null;
		WritableWorkbook workbook = null;
		
		try{
			
			os = response.getOutputStream();
			workbook = Workbook.createWorkbook(os);
			
			WritableSheet sheet = workbook.createSheet("复筛流行病学科研统计表", 0);
		
			//创建画笔
			//第一种画笔
			WritableFont wft = new WritableFont(WritableFont.ARIAL,20,WritableFont.BOLD,false,UnderlineStyle.NO_UNDERLINE,Colour.BLACK);
			WritableCellFormat wcfmt = new WritableCellFormat(wft);
			wcfmt.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			//设置水平居中
			wcfmt.setAlignment(Alignment.CENTRE);
			//设置垂直居中
			wcfmt.setVerticalAlignment(VerticalAlignment.CENTRE);
			wcfmt.setWrap(true);
			
			//第二种画笔
			WritableFont wft1 = new WritableFont(WritableFont.ARIAL,10,WritableFont.NO_BOLD,false,UnderlineStyle.NO_UNDERLINE,Colour.BLACK);
			WritableCellFormat wcfmt1 = new WritableCellFormat(wft1);
			wcfmt1.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			wcfmt1.setAlignment(Alignment.CENTRE);
			//设置垂直居中
			wcfmt1.setVerticalAlignment(VerticalAlignment.CENTRE);
			wcfmt1.setWrap(true);
			
			//第三种画笔
			WritableFont wft2 = new WritableFont(WritableFont.ARIAL,12,WritableFont.BOLD,false,UnderlineStyle.NO_UNDERLINE,Colour.BLACK);
			WritableCellFormat wcfmt2 = new WritableCellFormat(wft2);
			wcfmt2.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			//设置水平居中
			wcfmt2.setAlignment(Alignment.CENTRE);
			//设置垂直居中
			wcfmt2.setVerticalAlignment(VerticalAlignment.CENTRE);
			wcfmt2.setWrap(true);
			
			//设置列宽
			sheet.setColumnView(0, 8);
			sheet.setColumnView(1, 12);
			sheet.setColumnView(2, 12);
			sheet.setColumnView(3, 12);
			sheet.setColumnView(4, 16);
			sheet.setColumnView(5, 16);
			sheet.setColumnView(6, 16);
			sheet.setColumnView(6, 8);
			sheet.setColumnView(7, 24);
			sheet.setColumnView(8, 24);
			sheet.setColumnView(9, 12);
			sheet.setColumnView(10, 12);
			sheet.setColumnView(11, 12);
			sheet.setColumnView(12, 12);
			sheet.setColumnView(13, 12);
			sheet.setColumnView(16, 12);
			sheet.setColumnView(17, 12);
			sheet.setColumnView(18, 12);
			sheet.setColumnView(19, 8);
			sheet.setColumnView(20, 22);
			sheet.setColumnView(21, 22);
			sheet.setColumnView(22, 22);
			sheet.setColumnView(23, 22);
			sheet.setColumnView(24, 22);
			sheet.setColumnView(25, 22);
			sheet.setColumnView(26, 32);
			sheet.setColumnView(27, 40);
			sheet.setColumnView(28, 12);
			sheet.setColumnView(29, 16);
			sheet.setColumnView(30, 36);
			sheet.setColumnView(31, 22);
			sheet.setColumnView(32, 16);
			sheet.setColumnView(33, 16);
			sheet.setColumnView(34, 16);
			sheet.setColumnView(35, 12);
			sheet.setColumnView(36, 12);
			sheet.setColumnView(37, 24);
			sheet.setColumnView(38, 24);
			sheet.setColumnView(39, 24);
			sheet.setColumnView(40, 16);
			
			//设置行高
			

			//写入表头
			sheet.mergeCells(0, 0, columns.size()-1, 0);
			sheet.addCell(new Label(0, 0, sheetName, wcfmt));
			sheet.setRowView(0, 1000);
			
			
			//循环写入
			for(int i = 0 ; i< columns.size(); i ++ ){
				sheet.addCell(new Label (i,1,columns.get(i),wcfmt2));
			}
			sheet.setRowView(1, 450);
			
			//写入数据(有数据时)
			
			if(reportList != null && reportList.size() != 0){
				
				for(int i = 0 ; i<reportList.size(); i++){
					//获取复筛报告
					Map<String,Object> report = reportList.get(i);
					//序号
					sheet.addCell(new Label(0 , i + 2 , "" + (i + 1), wcfmt1));
					//复筛日期
					String createTime = ""+ report.get("createTime");
					if(StringUtils.isBlank(createTime)||"null".equals(createTime)){
						createTime = "/";
					} else {
						createTime = createTime.substring(0, 10);
					}
					sheet.addCell(new Label(1 , i + 2 ,createTime,wcfmt1));
					//姓名
					String patientName = "" + report.get("patientName");
					if(StringUtils.isBlank(patientName)||"null".equals(patientName)) {
						patientName = "/";
					}
					sheet.addCell(new Label(2,i+2,patientName,wcfmt1));
					//检查单位
					String hospital = "" + report.get("hospital");
					sheet.addCell(new Label(3 ,i + 2 ,hospital , wcfmt1));
					/*
					String sex = "" + report.get("sex");
					String sex = "" + report.get("sex");
					if(StringUtils.isBlank(sex)||"null".equals(sex)){
						sex = "/";
					} else {
						if("0".equals(sex)){
							sex = "男";
						} else if ("1".equals(sex)){
							sex = "女";
						} else{
							sex = "/";
						}
					}
					sheet.addCell(new Label(3 ,i + 2 ,sex , wcfmt1));
					*/
					//出生证号码
					String birthNum = "" + report.get("birthNum");
					if(StringUtils.isBlank(birthNum)||"null".equals(birthNum)){
						birthNum = "/";
					}
					sheet.addCell(new Label(4 , i+2 , birthNum , wcfmt1));
					/*
					String ageMonth = "" + report.get("ageMonth");
					if(StringUtils.isBlank(ageMonth)||"null".equals(ageMonth)){
						ageMonth = "/";
					}
					sheet.addCell(new Label(4 , i+2 , ageMonth , wcfmt1));
					*/
					//身份证号码
					String sfzNum = "" + report.get("sfzNum");
					if(StringUtils.isBlank(sfzNum)||"null".equals(sfzNum)){
						sfzNum = "/";
					}
					sheet.addCell(new Label(5 , i+2 , sfzNum , wcfmt1));
					//性别
					String sex = "" + report.get("sex");
					if(StringUtils.isBlank(sex)||"null".equals(sex)){
						sex = "/";
					} else {
						if("0".equals(sex)){
							sex = "男";
						} else if ("1".equals(sex)){
							sex = "女";
						} else{
							sex = "/";
						}
					}
					sheet.addCell(new Label(6,i + 2 ,sex , wcfmt1));
					/*
					String register = "" + report.get("register");
					if(StringUtils.isBlank(register)||"null".equals(register)){
						register = "/";
					}
					sheet.addCell(new Label(5 , i+ 2 ,register , wcfmt1));
					*/
					//初筛日期：年 月 日 时
					String birthday = "" + report.get("birthday");
					String birthTime = "" + report.get("birthTime");
					if(StringUtils.isBlank(birthday)||birthday.equals("null")){
						birthday = " / 年  / 月  / 日   ";
					}else{
						birthday = " " + birthday.substring(0,4) + " 年 "
								 + " " + birthday.substring(5,7) + " 月  "
								 + " " + birthday.substring(8,10) + " 日 ";
					}
					if(StringUtils.isBlank(birthTime)||birthTime.equals("null")){
						birthTime = " / 时";
					}else{
						birthTime = " " + birthTime + " 时";
					}
					sheet.addCell(new Label(7, i+2, birthday + birthTime , wcfmt1));
					//检查日期： 年 月 日 时
					//String createTime = String.valueOf(report.get("createTime"));
					if(StringUtils.isBlank(createTime)||createTime.equals("null")){
						createTime = " / 年  / 月  / 日   ";
					}else{
						createTime = " " + createTime.substring(0,4) + " 年 "
								   + " " + createTime.substring(5,7) + " 月  "
								   + " " + createTime.substring(8,10) + " 日 ";
					}
					String surveyTime = String.valueOf(report.get("surveyTime"));
					if(StringUtils.isBlank(surveyTime)||surveyTime.equals("null")){
						surveyTime = " / 时";
					}else{
						surveyTime = " " + surveyTime + " 时";
					}
					sheet.addCell(new Label(8,i+2,createTime + surveyTime,wcfmt1));
					
					//母亲姓名： 名字： 民族： 学历
					String mum = "" + report.get("mum");
					if(StringUtils.isBlank(mum)||mum.equals("null")){
						mum = " / ";
					}
					String mumNation = "" + report.get("mumNation");
					if(StringUtils.isBlank(mumNation)||mumNation.equals("null")){
						mumNation = " / ";
					}
					String mumEducation = "" + report.get("mumEducation");
					if(StringUtils.isBlank(mumEducation)||mumEducation.equals("null")){
						mumEducation = " / ";
					}
					//sheet.addCell(new Label(9, i+2 , mum + ":" + mumNation + ":" + mumEducation , wcfmt1));
					sheet.addCell(new Label(9, i+2 , mum, wcfmt1));
					sheet.addCell(new Label(10, i+2 , mumNation, wcfmt1));
					sheet.addCell(new Label(11, i+2 , mumEducation, wcfmt1));
					/*
					String xmPart = "" + report.get("xmPart");
					String xmPart1 = "";
					if(StringUtils.isBlank(xmPart)||"null".equals(xmPart)){
						xmPart1  = "/";
					} else {

						if("1".equals("" + xmPart.charAt(0))){
							xmPart1 = xmPart1 + "头颈部   ";
						}
						if("1".equals("" + xmPart.charAt(1))){
							xmPart1 = xmPart1 + "四肢   ";
						}
						if("1".equals("" + xmPart.charAt(2))){
							xmPart1 = xmPart1 + "躯干   ";
						}
						if("1".equals("" + xmPart.charAt(3))){
							xmPart1 = xmPart1 + "内脏   ";
						}
					}
					sheet.addCell(new Label(8, i+2 , xmPart1 , wcfmt1));
					*/
					//联系方式
					String mumTel = "" + report.get("mumTel");
					if(StringUtils.isBlank(mumTel)||mumTel.equals("null")){
						mumTel = " / ";
					} else {
						// 不是管理员登录并且患儿信息部位空的话,隐藏患儿信息
						if ("admin".equals(code)) {
							if (mumTel.length() > 7) {
								mumTel =  mumTel.substring(0, 4) + "***" + mumTel.substring(7, mumTel.length());
							}
						}
					}
					sheet.addCell(new Label(12, i+2, mumTel , wcfmt1));
					/*
					String Becho = "" + report.get("Becho");
					if(StringUtils.isBlank(Becho)||"null".equals(Becho)){
						Becho = "/";
					} else {
						if("0".equals(Becho)){
							Becho = "否";
						} else if ("1".equals(Becho)){
							Becho = "是";
						} else {
							Becho = "/";
						}
					}
					sheet.addCell(new Label(9 , i+2, Becho , wcfmt1));
					*/
					//父亲姓名：民族： 学历
					String dad = "" + report.get("dad");
					if(StringUtils.isBlank(dad)||dad.equals("null")){
						dad = " / ";
					}
					String dadNation = "" + report.get("dadNation");
					if(StringUtils.isBlank(dadNation)||dadNation.equals("null")){
						dadNation = " / ";
					}
					String dadEducation = "" + report.get("dadEducation");
					if(StringUtils.isBlank(dadEducation)||dadEducation.equals("null")){
						dadEducation = " / ";
					}
					//sheet.addCell(new Label(13, i+2 , dad + ":" + dadNation + ":" + dadEducation , wcfmt1));
					sheet.addCell(new Label(13, i+2 , dad, wcfmt1));
					sheet.addCell(new Label(14, i+2 , dadNation, wcfmt1));
					sheet.addCell(new Label(15, i+2 , dadEducation, wcfmt1));
					/*
					String Bblood = "" + report.get("Bblood");
					if(StringUtils.isBlank(Bblood)||"null".equals(Bblood)){
						Bblood = "/";
					} else {
						if("0".equals(Bblood)){
							Bblood = "否";
						} else if ("1".equals(Bblood)){
							Bblood = "是";
						} else {
							Bblood = "/";
						}
					}
					sheet.addCell(new Label(10 , i+2, Bblood , wcfmt1));
					*/
					//联系电话
					String dadTel = "" + report.get("dadTel");
					if(StringUtils.isBlank(dadTel)||dadTel.equals("null")){
						dadTel = " / ";
					} else {
						// 不是管理员登录并且患儿信息部位空的话,隐藏患儿信息
						if ("admin".equals(code)) {
							if (dadTel.length() > 7) {
								dadTel =  dadTel.substring(0, 4) + "***" + dadTel.substring(7, dadTel.length());
							}
						}
					}
					sheet.addCell(new Label(16, i+2, dadTel , wcfmt1));
					/*
					String Borgan = "" + report.get("Borgan");
					if(StringUtils.isBlank(Borgan)||"null".equals(Borgan)){
						Borgan = "/";
					} else {
						if("0".equals(Borgan)){
							Borgan = "否";
						} else if ("1".equals(Borgan)){
							Borgan = "是";
						} else {
							Borgan = "/";
						}
					}
					sheet.addCell(new Label(11 , i+2, Borgan , wcfmt1));
					*/
					//年龄
					String ageMonth = "" + report.get("ageMonth");
					if(StringUtils.isBlank(ageMonth)||"null".equals(ageMonth)){
						ageMonth = "/";
					}
					sheet.addCell(new Label(17, i+2 , ageMonth , wcfmt1));
					/*
					String xmShape = "" + report.get("xmShape");
					String xmSize = "" + report.get("xmSize");
					
					if(StringUtils.isNotBlank(xmShape)&&!xmShape.equals("null")){
						if("0".equals(xmShape)){
							xmShape = "小红点";
						}else if("1".equals(xmShape)){
							xmShape = "绿豆大小";
						}else if("2".equals(xmShape)){
							xmShape = "硬币大小";
						}else if("3".equals(xmShape)){
							xmShape = "鸡蛋大小";
						}
						sheet.addCell(new Label(12 ,i+2 , xmShape , wcfmt1));
					}else if(StringUtils.isNotBlank(xmSize)&&!xmSize.equals("null")){
						
						if("0".equals(xmSize)){
							xmSize = "<1cm";
						}else if("1".equals(xmSize)){
							xmSize = ">1cm";
						}else if("2".equals(xmSize)){
							xmSize = ">3cm";
						}else if("3".equals(xmSize)){
							xmSize = ">5cm";
						}else if("4".equals(xmSize)){
							xmSize = ">10cm";
						}
						sheet.addCell(new Label(12 ,i+2 , xmSize , wcfmt1));	
					}
					*/
					//家庭住址
					
					String address = "" + report.get("address");
					sheet.addCell(new Label(18, i+2 , address , wcfmt1));
					/*
					String xmColor = "" + report.get("xmColor");
					String xmColor1 = "";
					if(StringUtils.isBlank(xmColor)||"null".equals(xmColor)){
						xmColor1  = "/";
					} else {

						if("1".equals("" + xmColor.charAt(0))){
							xmColor1 = xmColor1 + "肤色   ";
						}
						if("1".equals("" + xmColor.charAt(1))){
							xmColor1 = xmColor1 + "红色   ";
						}
						if("1".equals("" + xmColor.charAt(2))){
							xmColor1 = xmColor1 + "暗紫红色   ";
						}
						if("1".equals("" + xmColor.charAt(3))){
							xmColor1 = xmColor1 + "蓝色   ";
						}
						if("1".equals("" + xmColor.charAt(4))){
							xmColor1 = xmColor1 + "青色   ";
						}
						if("1".equals("" + xmColor.charAt(5))){
							xmColor1 = xmColor1 + "黑色   ";
						}
						if("1".equals("" + xmColor.charAt(6))){
							xmColor1 = xmColor1 + "褐色   ";
						}
						if("1".equals("" + xmColor.charAt(7))){
							xmColor1 = xmColor1 + "粉红色   ";
						}
						if("1".equals("" + xmColor.charAt(8))){
							xmColor1 = xmColor1 + "浅红色   ";
						}	
					}
					sheet.addCell(new Label(13, i+2 , xmColor1 , wcfmt1));
					*/
					
					//户籍
					String register = "" + report.get("register");
					sheet.addCell(new Label(19, i+2 , register , wcfmt1));
					/*
					String xmFall = "" + report.get("xmFall");
					if(StringUtils.isBlank(xmFall)||"null".equals(xmFall)){
						xmFall = "/";
					} else {
						if("0".equals(xmFall)){
							xmFall = "否";
						} else if ("1".equals(xmFall)){
							xmFall = "是";
						} else {
							xmFall = "/";
						}
					}
					sheet.addCell(new Label(14 , i+2, xmFall , wcfmt1));
					*/
					//家族血亲三代史
					String jzsxm = "" + report.get("jzsxm");
					if(StringUtils.isBlank(jzsxm)||"null".equals(jzsxm)){
						jzsxm = "/";
					} else {
						if("0".equals(jzsxm)){
							jzsxm = "否";
						} else if ("1".equals(jzsxm)){
							jzsxm = "是";
						} else {
							jzsxm = "/";
						}
					}
					sheet.addCell(new Label(20, i+2, jzsxm , wcfmt1));
					/*
					String skinRaised = "" + report.get("skinRaised");
					if(StringUtils.isBlank(skinRaised)||"null".equals(skinRaised)){
						skinRaised = "/";
					} else {
						if("0".equals(skinRaised)){
							skinRaised = "否";
						} else if ("1".equals(skinRaised)){
							skinRaised = "是";
						} else {
							skinRaised = "/";
						}
					}
					sheet.addCell(new Label(15 , i+2, skinRaised , wcfmt1));
					*/
					//父母兄弟姐妹史
					String xdjmxm = "" + report.get("xdjmxm");
					if(StringUtils.isBlank(xdjmxm)||"null".equals(xdjmxm)){
						xdjmxm = "/";
					} else {
						if("0".equals(xdjmxm)){
							xdjmxm = "否";
						} else if ("1".equals(xdjmxm)){
							xdjmxm = "是";
						} else {
							xdjmxm = "/";
						}
					}
					sheet.addCell(new Label(21, i+2, xdjmxm , wcfmt1));

					//母孕产史
					String yunChan = "" + report.get("yunChan");
					if(StringUtils.isBlank(yunChan)||"null".equals(yunChan)){
						yunChan = "/";
					} else {
						if("0".equals(yunChan)){
							yunChan = "否";
						} else if ("1".equals(yunChan)){
							yunChan = "是";
						} else {
							yunChan = "/";
						}
					}
					sheet.addCell(new Label(22, i+2, yunChan , wcfmt1));
					
					//此孩怀孕年龄
					String yunAge = "" + report.get("yunAge");
					if(StringUtils.isBlank(yunAge)||"null".equals(yunAge)){
						yunAge = "/";
					}
					sheet.addCell(new Label(23, i+2 ,yunAge , wcfmt1));
					
					//孕期药物治疗史
					String drugHistory = "" + report.get("drugHistory");
					String drugHistory1 = "/";
					if(StringUtils.isBlank(drugHistory)||"null".equals(drugHistory)){
						drugHistory1  = "/";
					} else {

						if("1".equals("" + drugHistory.charAt(0))){
							drugHistory1 = drugHistory1 + "黄体酮   ";
						}
						if("1".equals("" + drugHistory.charAt(1))){
							drugHistory1 = drugHistory1 + "雌激素   ";
						}
						if("1".equals("" + drugHistory.charAt(2))){
							drugHistory1 = drugHistory1 + "氯米芬   ";
						}
						if("1".equals("" + drugHistory.charAt(3))){
							drugHistory1 = drugHistory1 + "克罗米芬   ";
						}
					
					}
					sheet.addCell(new Label(24, i+2 , drugHistory1 , wcfmt1));
					
					//孕期有家庭装修史
					String yunFitment = "" + report.get("yunFitment");
					if(StringUtils.isBlank(yunFitment)||"null".equals(yunFitment)){
						yunFitment = "/";
					} else {
						if("0".equals(yunFitment)){
							yunFitment = "否";
						} else if ("1".equals(yunFitment)){
							yunFitment = "是";
						} else {
							yunFitment = "/";
						}
					}
					sheet.addCell(new Label(25, i+2, yunFitment , wcfmt1));
					//母亲有无视频显示终端暴露
					String VDTs = "" + report.get("VDTs");
					if(StringUtils.isBlank(VDTs)||"null".equals(VDTs)){
						VDTs = "/";
					} else {
						if("0".equals(VDTs)){
							VDTs = "否";
						} else if ("1".equals(VDTs)){
							VDTs = "是";
						} else {
							VDTs = "/";
						}
					}
					sheet.addCell(new Label(26, i+2, VDTs , wcfmt1));
					
					//母亲饮用水（自来水、井水、河水）
					String mumDrink = "" + report.get("mumDrink");
					String mumDrink1 = "";
					if(StringUtils.isBlank(mumDrink)||"null".equals(mumDrink)||"000".equals(mumDrink)){
						mumDrink1  = "/";
					} else {

						if("1".equals("" + mumDrink.charAt(0))){
							mumDrink1 = mumDrink1 + "自来水   ";
						}
						if("1".equals("" + mumDrink.charAt(1))){
							mumDrink1 = mumDrink1 + "井水   ";
						}
						if("1".equals("" + mumDrink.charAt(2))){
							mumDrink1 = mumDrink1 + "河水   ";
						}
					}
					sheet.addCell(new Label(27, i+2 , mumDrink1 , wcfmt1));		
					
					//羊膜检测
					String amnioscopy = "" + report.get("amnioscopy");
					if(StringUtils.isBlank(amnioscopy)||"null".equals(amnioscopy)){
						amnioscopy = "/";
					} else {
						if("0".equals(amnioscopy)){
							amnioscopy = "否";
						} else if ("1".equals(amnioscopy)){
							amnioscopy = "是";
						} else {
							amnioscopy = "/";
						}
					}
					sheet.addCell(new Label(28, i+2, amnioscopy , wcfmt1));
					
					//羊膜囊穿刺
					String amniocentesis = "" + report.get("amniocentesis");
					if(StringUtils.isBlank(amniocentesis)||"null".equals(amniocentesis)){
						amniocentesis = "/";
					} else {
						if("0".equals(amniocentesis)){
							amniocentesis = "否";
						} else if ("1".equals(amniocentesis)){
							amniocentesis = "是";
						} else {
							amniocentesis = "/";
						}
					}
					sheet.addCell(new Label(29 , i+2, amniocentesis , wcfmt1));
					
					//母亲孕期有无外伤史或腹部撞击史
					String hurted = "" + report.get("hurted");
					if(StringUtils.isBlank(hurted)||"null".equals(hurted)){
						hurted = "/";
					} else {
						if("0".equals(hurted)){
							hurted = "否";
						} else if ("1".equals(hurted)){
							hurted = "是";
						} else {
							hurted = "/";
						}
					}
					sheet.addCell(new Label(30 , i+2, hurted , wcfmt1));

					//过敏源（）无（）
					String gmy = "" + report.get("gmy");
					String gmyDetail = "" + report.get("gmyDetail");
					if(StringUtils.isBlank(gmy)||"null".equals(gmy)){
						gmy = "/";
					} else if ("1".equals(gmy)) {
						gmy = "有";
					} else if ("0".equals(gmy)) {
						gmy = "无";
					}
					if(StringUtils.isBlank(gmyDetail)||"null".equals(gmyDetail)){
						gmyDetail = "/";
					}
					sheet.addCell(new Label(31, i+2, gmy + ":" + gmyDetail, wcfmt1));
					
					//孕期伴随情况
					String yunCase = "" + report.get("yunCase");
					String yunCase1 = "/";
					if(StringUtils.isBlank(yunCase)||"null".equals(yunCase)){
						yunCase1  = "/";
					} else {

						if("1".equals("" + yunCase.charAt(0))){
							yunCase1 = yunCase1 + "多胎妊娠   ";
						}
						if("1".equals("" + yunCase.charAt(1))){
							yunCase1 = yunCase1 + "单卵   ";
						}
						if("1".equals("" + yunCase.charAt(2))){
							yunCase1 = yunCase1 + "双卵   ";
						}
						if("1".equals("" + yunCase.charAt(3))){
							yunCase1 = yunCase1 + "先兆子痫   ";
						}
						if("1".equals("" + yunCase.charAt(4))){
							yunCase1 = yunCase1 + "前置胎盘   ";
						}
						if("1".equals("" + yunCase.charAt(5))){
							yunCase1 = yunCase1 + "早产   ";
						}
						if("1".equals("" + yunCase.charAt(6))){
							yunCase1 = yunCase1 + "先兆流产   ";
						}
						if("1".equals("" + yunCase.charAt(7))){
							yunCase1 = yunCase1 + "妊娠高血压   ";
						}
						if("1".equals("" + yunCase.charAt(8))){
							yunCase1 = yunCase1 + "胎位不正   ";
						}
						if("1".equals("" + yunCase.charAt(9))){
							yunCase1 = yunCase1 + "糖尿病   ";
						}
						if("1".equals("" + yunCase.charAt(10))){
							yunCase1 = yunCase1 + "病毒性肝炎   ";
						}
							
					}
					sheet.addCell(new Label(32, i+2 , yunCase1 , wcfmt1));
					
					//是否早产儿
					String isPremature = "";
					if(StringUtils.isBlank(yunCase)||"null".equals(yunCase)){
						isPremature  = "/";
					} else {
						if("1".equals(""+ yunCase.charAt(5))){
							isPremature = "是";
						} else if ("0".equals(""+ yunCase.charAt(5))){
							isPremature = "否";
						} else {
							isPremature  = "/";
						}
					}
					sheet.addCell(new Label(33, i+2 , isPremature ,wcfmt1));
					
					//患儿出生地
					String birthPlace = "" + report.get("birthPlace");
					if(StringUtils.isBlank(birthPlace)||"null".equals(birthPlace)){
						birthPlace = "/";
					}
					sheet.addCell(new Label(34, i+2 ,birthPlace,wcfmt1));
					
					//出生体重
					String birthWeight = "" + report.get("birthWeight");
					if(StringUtils.isBlank(birthWeight)||"null".equals(birthWeight)){
						birthWeight = "/";
					}
					sheet.addCell(new Label(35, i+2 ,birthWeight,wcfmt1));	
					
					//医生姓名
					String docName = "" + report.get("doctorName");
					if(StringUtils.isBlank(docName)||"null".equals(docName)){
						docName = "/";
					}
					sheet.addCell(new Label(36, i+2 ,docName,wcfmt1));
					
					// 复筛确诊患儿姓名
					String fcName = "" + report.get("fcName");
					if(StringUtils.isBlank(fcName)||"null".equals(fcName)){
						fcName = "/";
					}
					sheet.addCell(new Label(37, i+2 ,fcName,wcfmt1));
					
					// 复筛确诊患儿性别
					String fcSex = "" + report.get("fcSex");
					if(StringUtils.isBlank(fcSex)||"null".equals(fcSex)){
						fcSex = "/";
					}
					sheet.addCell(new Label(38, i+2 ,fcSex,wcfmt1));
					
					// 复筛确诊患儿年龄
					String fcAge = "" + report.get("fcAge");
					if(StringUtils.isBlank(fcAge)||"null".equals(fcAge)){
						fcAge = "/";
					}
					sheet.addCell(new Label(39, i+2 ,fcAge,wcfmt1));
					 
					// 是否人工助孕
					String rgYun = "" + report.get("rgYun");
					if(StringUtils.isBlank(rgYun)||"null".equals(rgYun)){
						rgYun = "否";
					} else {
						if ("1".equals(rgYun)) {
							rgYun = "是";
						} else if ("0".equals(rgYun)) {
							rgYun = "否";
						} else {
							rgYun = "/";
						}
					}	
					sheet.addCell(new Label(40, i+2 , rgYun, wcfmt1));
				}

			}
			
			workbook.write();
			
		}finally{
			workbook.close();
			os.flush();
			os.close();
		}
		
	}  
	
	/**
	 * 导出复筛报告单-全部
	 * @param response
	 * @param reportList
	 * @param sheetName
	 * @param columns
	 * @throws Exception 
	 */
	public static void fcReportAllToExcel(HttpServletResponse response,
			List<Map<String, Object>> reportList, String sheetName,
			List<String> columns) throws Exception {
		
		OutputStream os = null;
		WritableWorkbook workbook = null;
		
		try{
			
			os = response.getOutputStream();
			workbook = Workbook.createWorkbook(os);
			
			WritableSheet sheet = workbook.createSheet("复筛流行病学科研统计表", 0);
		
			//创建画笔
			//第一种画笔
			WritableFont wft = new WritableFont(WritableFont.ARIAL,20,WritableFont.BOLD,false,UnderlineStyle.NO_UNDERLINE,Colour.BLACK);
			WritableCellFormat wcfmt = new WritableCellFormat(wft);
			wcfmt.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			//设置水平居中
			wcfmt.setAlignment(Alignment.CENTRE);
			//设置垂直居中
			wcfmt.setVerticalAlignment(VerticalAlignment.CENTRE);
			wcfmt.setWrap(true);
			
			//第二种画笔
			WritableFont wft1 = new WritableFont(WritableFont.ARIAL,10,WritableFont.NO_BOLD,false,UnderlineStyle.NO_UNDERLINE,Colour.BLACK);
			WritableCellFormat wcfmt1 = new WritableCellFormat(wft1);
			wcfmt1.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			//设置垂直居中
			wcfmt1.setVerticalAlignment(VerticalAlignment.CENTRE);
			wcfmt1.setWrap(true);
			
			//第三种画笔
			WritableFont wft2 = new WritableFont(WritableFont.ARIAL,12,WritableFont.BOLD,false,UnderlineStyle.NO_UNDERLINE,Colour.BLACK);
			WritableCellFormat wcfmt2 = new WritableCellFormat(wft2);
			wcfmt2.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
			//设置水平居中
			wcfmt2.setAlignment(Alignment.CENTRE);
			//设置垂直居中
			wcfmt2.setVerticalAlignment(VerticalAlignment.CENTRE);
			wcfmt2.setWrap(true);
			
			//设置列宽
			sheet.setColumnView(0, 6);
			sheet.setColumnView(1, 12);
			sheet.setColumnView(2, 12);
			//sheet.setColumnView(3, 12);
			//sheet.setColumnView(4, 12);
			sheet.setColumnView(3, 12);
			sheet.setColumnView(4, 12);
			sheet.setColumnView(15, 5);
			//sheet.setColumnView(24, 5);
			sheet.setColumnView(20, 6);
			sheet.setColumnView(22, 6);
			sheet.setColumnView(24, 12);
			sheet.setColumnView(25, 5);
			sheet.setColumnView(26, 5);
			sheet.setColumnView(32, 7);
			sheet.setColumnView(27, 12);
			sheet.setColumnView(28, 20);
			sheet.setColumnView(32, 20);
			sheet.setColumnView(30, 5);
			sheet.setColumnView(35, 12);
			sheet.setColumnView(36, 12);
			sheet.setColumnView(37, 12);
			sheet.setColumnView(38, 12);
			sheet.setColumnView(39, 12);
			sheet.setColumnView(40, 12);
			sheet.setColumnView(41, 12);
			sheet.setColumnView(42, 12);
			sheet.setColumnView(43, 12);
			sheet.setColumnView(44, 12);
			//设置行高

			//写入表头
			sheet.mergeCells(0, 0, columns.size()-1, 0);
			sheet.addCell(new Label(0, 0, sheetName, wcfmt));
			sheet.setRowView(0, 1000);
			
			
			//循环写入
			for(int i = 0 ; i< columns.size(); i ++ ){
				sheet.addCell(new Label (i,1,columns.get(i),wcfmt2));
			}
			sheet.setRowView(0, 1400);
			
			//写入数据(有数据时)
			if(reportList != null && reportList.size() != 0){
				
				for(int i = 0 ; i<reportList.size(); i++){
					//获取复筛报告
					Map<String,Object> report = reportList.get(i);
					//序号
					sheet.addCell(new Label(0 , i + 2 , "" + (i + 1), wcfmt1));
					//复筛日期
					String createTime = ""+ report.get("createTime");
					if(StringUtils.isBlank(createTime)||"null".equals(createTime)){
						createTime = "/";
					} else {
						createTime = createTime.substring(0, 10);
					}
					sheet.addCell(new Label(1 , i + 2 ,createTime,wcfmt1));
					
					//检查单位
					String hospital = ""+ report.get("hospital");
					if(StringUtils.isBlank(hospital)||"null".equals(hospital)){
						hospital = "/";
					} 
					sheet.addCell(new Label(2 , i + 2 ,hospital,wcfmt1));
					
					//出生证号
//					String birthNum = ""+ report.get("birthNum");
//					if(StringUtils.isBlank(birthNum)||"null".equals(birthNum)){
//						birthNum = "/";
//					} 
//					sheet.addCell(new Label(3 , i + 2 ,birthNum,wcfmt1));
					
					//身份证号
//					String sfzNum = ""+ report.get("sfzNum");
//					if(StringUtils.isBlank(sfzNum)||"null".equals(sfzNum)){
//						sfzNum = "/";
//					}
//					sheet.addCell(new Label(4 , i + 2 ,sfzNum,wcfmt1));
					
					//姓名
					String patientName = "" + report.get("patientName");
					if(StringUtils.isBlank(patientName)||"null".equals(patientName)) {
						patientName = "/";
					}
					sheet.addCell(new Label(3,i+2,patientName,wcfmt1));
					//性别
					String sex = "" + report.get("sex");
					if(StringUtils.isBlank(sex)||"null".equals(sex)){
						sex = "/";
					} else {
						if("0".equals(sex)){
							sex = "男";
						} else if ("1".equals(sex)){
							sex = "女";
						} else{
							sex = "/";
						}
					}
					sheet.addCell(new Label(4 ,i + 2 ,sex , wcfmt1));
					//年龄
//					String ageMonth = "" + report.get("ageMonth");
					String ageMonth = "" + report.get("firstAge");
					if(StringUtils.isBlank(ageMonth)||"null".equals(ageMonth)){
						ageMonth = "/";
					}
					sheet.addCell(new Label(5 , i+2 , ageMonth , wcfmt1));
					//户籍
					String register = "" + report.get("register");
					if(StringUtils.isBlank(register)||"null".equals(register)){
						register = "/";
					}
					sheet.addCell(new Label(6 , i+ 2 ,register , wcfmt1));
					//血管瘤或胎记个数
					String xmNum = "" + report.get("xmNum");
					if(StringUtils.isBlank(xmNum)||"null".equals(xmNum)){
						xmNum = "/";
					} else {
						if("0".equals(xmNum)){
							xmNum = "单个";
						} else if ("1".equals(xmNum)){
							xmNum = "多个";
						} else {
							xmNum = "/";
						}
					}
					sheet.addCell(new Label(7 , i+2, xmNum , wcfmt1));
					//血管瘤或胎记增长速度
					String xmGrow = "" + report.get("xmGrow");
					if(StringUtils.isBlank(xmGrow)||"null".equals(xmGrow)){
						xmGrow = "/";
					} else {
						if("0".equals(xmGrow)){
							xmGrow = "快速";
						} else if("1".equals(xmGrow)){
							xmGrow = "缓慢";
						} else if("2".equals(xmGrow)){
							xmGrow = "无变化";
						} else {
							xmGrow = "/";
						}
					}
					sheet.addCell(new Label(8,i+2,xmGrow,wcfmt1));
					
					//血管瘤或胎记发病部位
					String xmPart = "" + report.get("xmPart");
					String xmPart1 = "/";
					if(StringUtils.isBlank(xmPart)||"null".equals(xmPart)||"0000".equals(xmPart)){
						xmPart1  = "/";
					} else {

						if("1".equals("" + xmPart.charAt(0))){
							xmPart1 = xmPart1 + "头颈部   ";
						}
						if("1".equals("" + xmPart.charAt(1))){
							xmPart1 = xmPart1 + "四肢   ";
						}
						if("1".equals("" + xmPart.charAt(2))){
							xmPart1 = xmPart1 + "躯干   ";
						}
						if("1".equals("" + xmPart.charAt(3))){
							xmPart1 = xmPart1 + "内脏   ";
						}
					}
					sheet.addCell(new Label(9, i+2 , xmPart1 , wcfmt1));
					
					//B超显示低回声有无
					String Becho = "" + report.get("Becho");
					if(StringUtils.isBlank(Becho)||"null".equals(Becho)){
						Becho = "/";
					} else {
						if("0".equals(Becho)){
							Becho = "否";
						} else if ("1".equals(Becho)){
							Becho = "是";
						} else {
							Becho = "/";
						}
					}
					sheet.addCell(new Label(10 , i+2, Becho , wcfmt1));
					
					//B超显示明显血流血流信号有无
					String Bblood = "" + report.get("Bblood");
					if(StringUtils.isBlank(Bblood)||"null".equals(Bblood)){
						Bblood = "/";
					} else {
						if("0".equals(Bblood)){
							Bblood = "否";
						} else if ("1".equals(Bblood)){
							Bblood = "是";
						} else {
							Bblood = "/";
						}
					}
					sheet.addCell(new Label(11 , i+2, Bblood , wcfmt1));
					
					//内脏血管瘤B超有无
					String Borgan = "" + report.get("Borgan");
					if(StringUtils.isBlank(Borgan)||"null".equals(Borgan)){
						Borgan = "/";
					} else {
						if("0".equals(Borgan)){
							Borgan = "否";
						} else if ("1".equals(Borgan)){
							Borgan = "是";
						} else {
							Borgan = "/";
						}
					}
					sheet.addCell(new Label(12 , i+2, Borgan , wcfmt1));
					
					//血管瘤或胎记大小
					String xmShape = "" + report.get("xmShape");
					String xmSize = "" + report.get("xmSize");
					
					if(StringUtils.isNotBlank(xmShape)&&!xmShape.equals("null")){
						if("0".equals(xmShape)){
							xmShape = "小红点";
						}else if("1".equals(xmShape)){
							xmShape = "绿豆大小";
						}else if("2".equals(xmShape)){
							xmShape = "硬币大小";
						}else if("3".equals(xmShape)){
							xmShape = "鸡蛋大小";
						}
						sheet.addCell(new Label(13 ,i+2 , xmShape , wcfmt1));
					}else if(StringUtils.isNotBlank(xmSize)&&!xmSize.equals("null")){
						
						if("0".equals(xmSize)){
							xmSize = "<1cm";
						}else if("1".equals(xmSize)){
							xmSize = ">1cm";
						}else if("2".equals(xmSize)){
							xmSize = ">3cm";
						}else if("3".equals(xmSize)){
							xmSize = ">5cm";
						}else if("4".equals(xmSize)){
							xmSize = ">10cm";
						}
						sheet.addCell(new Label(13 ,i+2 , xmSize , wcfmt1));	
					}
					
					//血管瘤或胎记肤色
					String xmColor = "" + report.get("xmColor");
					String xmColor1 = "/";
					if(StringUtils.isBlank(xmColor)||"null".equals(xmColor)){
						xmColor1  = "/";
					} else {

						if("1".equals("" + xmColor.charAt(0))){
							xmColor1 = xmColor1 + "肤色   ";
						}
						if("1".equals("" + xmColor.charAt(1))){
							xmColor1 = xmColor1 + "红色   ";
						}
						if("1".equals("" + xmColor.charAt(2))){
							xmColor1 = xmColor1 + "暗紫红色   ";
						}
						if("1".equals("" + xmColor.charAt(3))){
							xmColor1 = xmColor1 + "蓝色   ";
						}
						if("1".equals("" + xmColor.charAt(4))){
							xmColor1 = xmColor1 + "青色   ";
						}
						if("1".equals("" + xmColor.charAt(5))){
							xmColor1 = xmColor1 + "黑色   ";
						}
						if("1".equals("" + xmColor.charAt(6))){
							xmColor1 = xmColor1 + "褐色   ";
						}
						if("1".equals("" + xmColor.charAt(7))){
							xmColor1 = xmColor1 + "粉红色   ";
						}
						if("1".equals("" + xmColor.charAt(8))){
							xmColor1 = xmColor1 + "浅红色   ";
						}	
					}
					sheet.addCell(new Label(14, i+2 , xmColor1 , wcfmt1));
					
					
					//是否消退
					String xmFall = "" + report.get("xmFall");
					if(StringUtils.isBlank(xmFall)||"null".equals(xmFall)){
						xmFall = "/";
					} else {
						if("0".equals(xmFall)){
							xmFall = "否";
						} else if ("1".equals(xmFall)){
							xmFall = "是";
						} else {
							xmFall = "/";
						}
					}
					sheet.addCell(new Label(15 , i+2, xmFall , wcfmt1));
					
					//皮肤局部有无突起
					String skinRaised = "" + report.get("skinRaised");
					if(StringUtils.isBlank(skinRaised)||"null".equals(skinRaised)){
						skinRaised = "/";
					} else {
						if("0".equals(skinRaised)){
							skinRaised = "否";
						} else if ("1".equals(skinRaised)){
							skinRaised = "是";
						} else {
							skinRaised = "/";
						}
					}
					sheet.addCell(new Label(16 , i+2, skinRaised , wcfmt1));
					
					//家族血亲三代史
					String jzsxm = "" + report.get("jzsxm");
					if(StringUtils.isBlank(jzsxm)||"null".equals(jzsxm)){
						jzsxm = "/";
					} else {
						if("0".equals(jzsxm)){
							jzsxm = "否";
						} else if ("1".equals(jzsxm)){
							jzsxm = "是";
						} else {
							jzsxm = "/";
						}
					}
					sheet.addCell(new Label(17 , i+2, jzsxm , wcfmt1));

					//父母兄弟姐妹史
					String xdjmxm = "" + report.get("xdjmxm");
					if(StringUtils.isBlank(xdjmxm)||"null".equals(xdjmxm)){
						xdjmxm = "/";
					} else {
						if("0".equals(xdjmxm)){
							xdjmxm = "否";
						} else if ("1".equals(xdjmxm)){
							xdjmxm = "是";
						} else {
							xdjmxm = "/";
						}
					}
					sheet.addCell(new Label(18 , i+2, xdjmxm , wcfmt1));
					
					//母孕产史
					String yunChan = "" + report.get("yunChan");
					if(StringUtils.isBlank(yunChan)||"null".equals(yunChan)){
						yunChan = "/";
					} else {
						if("0".equals(yunChan)){
							yunChan = "否";
						} else if ("1".equals(yunChan)){
							yunChan = "是";
						} else {
							yunChan = "/";
						}
					}
					sheet.addCell(new Label(19 , i+2, yunChan , wcfmt1));
					
					//此孩怀孕年龄
					String yunAge = "" + report.get("yunAge");
					if(StringUtils.isBlank(yunAge)||"null".equals(yunAge)){
						yunAge = "/";
					}
					sheet.addCell(new Label(20, i+2 ,yunAge , wcfmt1));
					
					//孕期药物治疗史
					String drugHistory = "" + report.get("drugHistory");
					String drugHistory1 = "";
					if(StringUtils.isBlank(drugHistory)||"null".equals(drugHistory)
							||"0000".equals(drugHistory)){
						drugHistory1  = "/";
					} else {

						if("1".equals("" + drugHistory.charAt(0))){
							drugHistory1 = drugHistory1 + "黄体酮   ";
						}
						if("1".equals("" + drugHistory.charAt(1))){
							drugHistory1 = drugHistory1 + "雌激素   ";
						}
						if("1".equals("" + drugHistory.charAt(2))){
							drugHistory1 = drugHistory1 + "氯米芬   ";
						}
						if("1".equals("" + drugHistory.charAt(3))){
							drugHistory1 = drugHistory1 + "克罗米芬   ";
						}
					
					}
					sheet.addCell(new Label(21, i+2 , drugHistory1 , wcfmt1));
					//孕期有家庭装修史
					String yunFitment = "" + report.get("yunFitment");
					if(StringUtils.isBlank(yunFitment)||"null".equals(yunFitment)){
						yunFitment = "/";
					} else {
						if("0".equals(yunFitment)){
							yunFitment = "否";
						} else if ("1".equals(yunFitment)){
							yunFitment = "是";
						} else {
							yunFitment = "/";
						}
					}
					sheet.addCell(new Label(22 , i+2, yunFitment , wcfmt1));
					
					//母亲有无视频显示终端暴露
					String VDTs = "" + report.get("VDTs");
					if(StringUtils.isBlank(VDTs)||"null".equals(VDTs)){
						VDTs = "/";
					} else {
						if("0".equals(VDTs)){
							VDTs = "否";
						} else if ("1".equals(VDTs)){
							VDTs = "是";
						} else {
							VDTs = "/";
						}
					}
					sheet.addCell(new Label(23 , i+2, VDTs , wcfmt1));
					
					//母亲饮用水（自来水、井水、河水）
					String mumDrink = "" + report.get("mumDrink");
					String mumDrink1 = "";
					if(StringUtils.isBlank(mumDrink)||"null".equals(mumDrink)
							||"000".equals(mumDrink)){
						mumDrink1  = "/";
					} else {

						if("1".equals("" + mumDrink.charAt(0))){
							mumDrink1 = mumDrink1 + "自来水   ";
						}
						if("1".equals("" + mumDrink.charAt(1))){
							mumDrink1 = mumDrink1 + "井水   ";
						}
						if("1".equals("" + mumDrink.charAt(2))){
							mumDrink1 = mumDrink1 + "河水   ";
						}
					}
					sheet.addCell(new Label(24, i+2 , mumDrink1 , wcfmt1));
					
					//羊膜检测
					String amnioscopy = "" + report.get("amnioscopy");
					if(StringUtils.isBlank(amnioscopy)||"null".equals(amnioscopy)){
						amnioscopy = "/";
					} else {
						if("0".equals(amnioscopy)){
							amnioscopy = "否";
						} else if ("1".equals(amnioscopy)){
							amnioscopy = "是";
						} else {
							amnioscopy = "/";
						}
					}
					sheet.addCell(new Label(25 , i+2, amnioscopy , wcfmt1));
					
					//羊膜囊穿刺
					String amniocentesis = "" + report.get("amniocentesis");
					if(StringUtils.isBlank(amniocentesis)||"null".equals(amniocentesis)){
						amniocentesis = "/";
					} else {
						if("0".equals(amniocentesis)){
							amniocentesis = "否";
						} else if ("1".equals(amniocentesis)){
							amniocentesis = "是";
						} else {
							amniocentesis = "/";
						}
					}
					sheet.addCell(new Label(26 , i+2, amniocentesis , wcfmt1));
					
					//母亲孕期有无外伤史或腹部撞击史
					String hurted = "" + report.get("hurted");
					if(StringUtils.isBlank(hurted)||"null".equals(hurted)){
						hurted = "/";
					} else {
						if("0".equals(hurted)){
							hurted = "否";
						} else if ("1".equals(hurted)){
							hurted = "是";
						} else {
							hurted = "/";
						}
					}
					sheet.addCell(new Label(27 , i+2, hurted , wcfmt1));

					//血管瘤治疗情况
					String cureDrug = "" + report.get("cureDrug");
					String cureOther = "" + report.get("cureOther");
					if(StringUtils.isBlank(cureDrug)||"null".equals(cureDrug)){
						cureDrug = "/";
					}
					if(StringUtils.isBlank(cureOther)||"null".equals(cureOther)){
						cureOther = "/";
					}
					sheet.addCell(new Label(28, i+2,
							"口服药物：" + cureDrug + ";其他治疗：" + cureOther , wcfmt1));
					
					//孕期伴随情况
					String yunCase = "" + report.get("yunCase");
					String yunCase1 = "/";
					if(StringUtils.isBlank(yunCase)||"null".equals(yunCase)){
						yunCase1  = "/";
					} else {

						if("1".equals("" + yunCase.charAt(0))){
							yunCase1 = yunCase1 + "多胎妊娠   ";
						}
						if("1".equals("" + yunCase.charAt(1))){
							yunCase1 = yunCase1 + "单卵   ";
						}
						if("1".equals("" + yunCase.charAt(2))){
							yunCase1 = yunCase1 + "双卵   ";
						}
						if("1".equals("" + yunCase.charAt(3))){
							yunCase1 = yunCase1 + "先兆子痫   ";
						}
						if("1".equals("" + yunCase.charAt(4))){
							yunCase1 = yunCase1 + "前置胎盘   ";
						}
						if("1".equals("" + yunCase.charAt(5))){
							yunCase1 = yunCase1 + "早产   ";
						}
						if("1".equals("" + yunCase.charAt(6))){
							yunCase1 = yunCase1 + "先兆流产   ";
						}
						if("1".equals("" + yunCase.charAt(7))){
							yunCase1 = yunCase1 + "妊娠高血压   ";
						}
						if("1".equals("" + yunCase.charAt(8))){
							yunCase1 = yunCase1 + "胎位不正   ";
						}
						if("1".equals("" + yunCase.charAt(9))){
							yunCase1 = yunCase1 + "糖尿病   ";
						}
						if("1".equals("" + yunCase.charAt(10))){
							yunCase1 = yunCase1 + "病毒性肝炎   ";
						}
					}
					sheet.addCell(new Label(29, i+2 , yunCase1 , wcfmt1));
					
					//是否早产儿
					String isPremature = "";
					if(StringUtils.isBlank(yunCase)||"null".equals(yunCase)){
						isPremature  = "/";
					} else {
						if("1".equals(""+ yunCase.charAt(5))){
							isPremature = "是";
						} else if ("0".equals(""+ yunCase.charAt(5))){
							isPremature = "否";
						} else {
							isPremature  = "/";
						}
					}
					sheet.addCell(new Label(30, i+2 , isPremature ,wcfmt1));
					
					//患儿出生地
					String birthPlace = "" + report.get("birthPlace");
					if(StringUtils.isBlank(birthPlace)||"null".equals(birthPlace)){
						birthPlace = "/";
					}
					sheet.addCell(new Label(31, i+2 ,birthPlace,wcfmt1));
					
					//出生体重
					String birthWeight = "" + report.get("birthWeight");
					if(StringUtils.isBlank(birthWeight)||"null".equals(birthWeight)){
						birthWeight = "/";
					}
					sheet.addCell(new Label(32, i+2 ,birthWeight,wcfmt1));
					
					//血管瘤并发疾病及血管瘤合并疾病
					String xmCase = "" + report.get("xmCase");
					String xmCase1 = "/";
					if(StringUtils.isBlank(xmCase)||"null".equals(xmCase)){
						xmCase1  = "/";
					} else {

						if("1".equals("" + xmCase.charAt(0))){
							xmCase1 = xmCase1 + "溃疡   ";
						}
						if("1".equals("" + xmCase.charAt(1))){
							xmCase1 = xmCase1 + "出血   ";
						}
						if("1".equals("" + xmCase.charAt(2))){
							xmCase1 = xmCase1 + "睡眠打鼾  ";
						}
						if("1".equals("" + xmCase.charAt(3))){
							xmCase1 = xmCase1 + "呼吸困难   ";
						}
						if("1".equals("" + xmCase.charAt(4))){
							xmCase1 = xmCase1 + "吞咽障碍   ";
						}
						if("1".equals("" + xmCase.charAt(5))){
							xmCase1 = xmCase1 + "眼部疾病影响视力   ";
						}
						if("1".equals("" + xmCase.charAt(6))){
							xmCase1 = xmCase1 + "心衰   ";
						}
						if("1".equals("" + xmCase.charAt(7))){
							xmCase1 = xmCase1 + "脑部病变   ";
						}
						if("1".equals("" + xmCase.charAt(8))){
							xmCase1 = xmCase1 + "其他   ";
						}
						if("1".equals("" + xmCase.charAt(9))){
							xmCase1 = xmCase1 + "暂无   ";
						}
							
					}
					sheet.addCell(new Label(33, i+2 , xmCase1 , wcfmt1));
					
					//血常规（PLT/VEGF）
					String VEGF = "" + report.get("VEGF");
					if(StringUtils.isBlank(VEGF)||"null".equals(VEGF)){
						VEGF = "/";
					}
					sheet.addCell(new Label(34, i+ 2 ,VEGF,wcfmt1));
					
					//初步诊断
					String Pdiagnose = "" + report.get("Pdiagnose");
					if(StringUtils.isBlank(Pdiagnose)||"null".equals(Pdiagnose)){
						Pdiagnose = "/";
					} else {
						if("0".equals(Pdiagnose)){
							Pdiagnose = "真性血管瘤";
						} else if ("1".equals(Pdiagnose)){
							Pdiagnose = "血管畸形";
						} else if ("2".equals(Pdiagnose)){
							Pdiagnose = "淋巴畸形";
						} else if ("3".equals(Pdiagnose)){
							Pdiagnose = "脉管畸形";
						} else if ("4".equals(Pdiagnose)){
							Pdiagnose = "其他色素痣";
						} else {
							Pdiagnose = "/";
						}
					}
					sheet.addCell(new Label(35 , i+2, Pdiagnose , wcfmt1));
					
					//血管瘤类型
					
					String xmType = "" + report.get("xmType");
					if(StringUtils.isBlank(xmType)||"null".equals(xmType)){
						xmType = "/";
					} else {
						if("0".equals(xmType)){
							xmType = "表浅型";
						} else if ("1".equals(xmType)){
							xmType = "深部型";
						} else if ("2".equals(xmType)){
							xmType = "深浅混合型";
						} else {
							xmType = "/";
						}
					}
					sheet.addCell(new Label(36 , i+2, xmType , wcfmt1));
					//皮肤病变处特质
					String disease = "" + report.get("disease");
					if(StringUtils.isBlank(disease) || disease.equals("null")){
						disease = "/";
					}else{
						if("0".equals(disease)){
							disease = "柔软";
						}else if("1".equals(disease)){
							disease = "较硬";
						}else {
							disease = "/";
						}
					}
					sheet.addCell(new Label(37 , i+2 , disease ,wcfmt1));
					
					// 是否人工助孕
					String rgYun = "" + report.get("rgYun");
					if(StringUtils.isBlank(rgYun)||"null".equals(rgYun)){
						rgYun = "否";
					} else {
						if ("1".equals(rgYun)) {
							rgYun = "是";
						} else if ("0".equals(rgYun)) {
							rgYun = "否";
						} else {
							rgYun = "/";
						}
					}
					sheet.addCell(new Label(38 , i+2, rgYun , wcfmt1));
					
					// 母亲姓名
					String mum = "" + report.get("motherName");
					if(StringUtils.isBlank(mum)||mum.equals("null")){
						mum = " / ";
					}
					sheet.addCell(new Label(39 , i+2, mum , wcfmt1));
					
					// 母亲民族
					String mumNation = "" + report.get("mumNation");
					if(StringUtils.isBlank(mumNation)||mumNation.equals("null")){
						mumNation = " / ";
					}
					sheet.addCell(new Label(40 , i+2, mumNation , wcfmt1));
					
					// 母亲学历
					String mumEducation = "" + report.get("mumEducation");
					if(StringUtils.isBlank(mumEducation)||mumEducation.equals("null")){
						mumEducation = " / ";
					}
					sheet.addCell(new Label(41 , i+2, mumEducation , wcfmt1));
					
					// 母亲联系电话
					String mumTel = "" + report.get("motherPhone");
					if(StringUtils.isBlank(mumTel)||mumTel.equals("null")){
						mumTel = " / ";
					}
					sheet.addCell(new Label(42 , i+2, mumTel , wcfmt1));
					
					// 父亲姓名
					String dad = "" + report.get("fatherName");
					if(StringUtils.isBlank(dad)||dad.equals("null")){
						dad = " / ";
					}
					sheet.addCell(new Label(43 , i+2, dad , wcfmt1));
					
					// 父亲民族
					String dadNation = "" + report.get("dadNation");
					if(StringUtils.isBlank(dadNation)||dadNation.equals("null")){
						dadNation = " / ";
					}
					sheet.addCell(new Label(44 , i+2, dadNation , wcfmt1));
					
					// 父亲学历
					String dadEducation = "" + report.get("dadEducation");
					if(StringUtils.isBlank(dadEducation)||dadEducation.equals("null")){
						dadEducation = " / ";
					}
					sheet.addCell(new Label(45 , i+2, dadEducation , wcfmt1));
					
					// 父亲联系电话
					String dadTel = "" + report.get("fatherPhone");
					if(StringUtils.isBlank(dadTel)||dadTel.equals("null")){
						dadTel = " / ";
					}
					sheet.addCell(new Label(46 , i+2, mumTel , wcfmt1));
				}

			}
			
			workbook.write();
			
		}finally{
			workbook.close();
			os.flush();
			os.close();
		}
		
	}


	/**
	 * 导出巡更记录表
	 *
	 * @param response	the response
	 * @param patrolRecordVoList	the patrol record vo list
	 * @param titleName	the title name
	 * @param sheetName	the sheet name
	 */
    public static void patrolRecordDown(HttpServletResponse response, List<PatrolRecordVo> patrolRecordVoList, String titleName, String sheetName) {

		OutputStream os = null;
		WritableWorkbook workbook = null;

		try {

			os = response.getOutputStream();
			workbook = Workbook.createWorkbook(os);

			WritableSheet sheet = workbook.createSheet(sheetName, 0);

			//创建画笔
			//第一种画笔
			WritableFont wft = new WritableFont(WritableFont.ARIAL, 20, WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK);
			WritableCellFormat wcfmt = new WritableCellFormat(wft);
			wcfmt.setBorder(jxl.format.Border.ALL, jxl.format.BorderLineStyle.THIN);
			//设置水平居中
			wcfmt.setAlignment(Alignment.CENTRE);
			//设置垂直居中
			wcfmt.setVerticalAlignment(VerticalAlignment.CENTRE);
			wcfmt.setWrap(true);

			//第二种画笔
			WritableFont wft1 = new WritableFont(WritableFont.ARIAL, 12, WritableFont.NO_BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK);
			WritableCellFormat wcfmt1 = new WritableCellFormat(wft1);
			wcfmt1.setBorder(jxl.format.Border.ALL, jxl.format.BorderLineStyle.THIN);
			wcfmt1.setAlignment(Alignment.CENTRE);
			//设置垂直居中
			wcfmt1.setVerticalAlignment(VerticalAlignment.CENTRE);
			wcfmt1.setWrap(true);

			//第三种画笔
			WritableFont wft2 = new WritableFont(WritableFont.ARIAL, 12, WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK);
			WritableCellFormat wcfmt2 = new WritableCellFormat(wft2);
			wcfmt2.setBorder(jxl.format.Border.ALL, jxl.format.BorderLineStyle.THIN);
			//设置水平居中
			wcfmt2.setAlignment(Alignment.CENTRE);
			//设置垂直居中
			wcfmt2.setVerticalAlignment(VerticalAlignment.CENTRE);
			wcfmt2.setWrap(true);

			// 第一行
			sheet.mergeCells(0, 0, 5, 0);
			sheet.addCell(new Label(0, 0, titleName, wcfmt));
			sheet.setRowView(0, 1000);

			// ************************ 表头 第二行 ************************//
			// 表头 ==> 序号
			sheet.addCell(new Label(0, 1, "序号", wcfmt2));
			// 表头 ==> 巡更人
			sheet.addCell(new Label(1, 1, "巡更人", wcfmt2));
			// 表头 ==> 巡更位置
			sheet.addCell(new Label(2, 1, "巡更位置", wcfmt2));
			// 表头 ==> 巡更时间
			sheet.addCell(new Label(3, 1, "巡更时间", wcfmt2));
			// 表头 ==> 巡更棒编号
			sheet.addCell(new Label(4, 1, "巡更棒编号", wcfmt2));
			// 表头 ==> 巡更点编号
			sheet.addCell(new Label(5, 1, "巡更点编号", wcfmt2));

			// 设置高度
			sheet.setRowView(2, 450);       // 第二行

			// 设置宽度
			sheet.setColumnView(0, 10);     // 序号
			sheet.setColumnView(1, 25);     // 巡更人
			sheet.setColumnView(2, 30);     // 巡更位置
			sheet.setColumnView(3, 30);     // 巡更时间
			sheet.setColumnView(4, 25);     // 巡更棒编号
			sheet.setColumnView(5, 25);     // 巡更点编号

			// 体温记录
			int row = 1;
			if (PublicUtil.isNotEmpty(patrolRecordVoList)) {
				for (PatrolRecordVo prv : patrolRecordVoList) {
					// 序号
					sheet.addCell(new Label(0, row + 1, String.valueOf(row), wcfmt2));
					// 巡更人
					sheet.addCell(new Label(1, row + 1, prv.getUserName(), wcfmt1));
					// 巡更位置
					sheet.addCell(new Label(2, row + 1, prv.getLocation(), wcfmt1));
					// 巡更时间
					sheet.addCell(new Label(3, row + 1, prv.getPatrolTime(), wcfmt1));
					// 巡更棒编号
					sheet.addCell(new Label(4, row + 1, prv.getGreatNo(), wcfmt1));
					// 巡更点编号
					sheet.addCell(new Label(5, row + 1, prv.getPointNo(), wcfmt1));

					// 设置高度
					sheet.setRowView(row, 450);

					// 换下一行
					row++;
				}
			}


			// 写入Excel工作表
			workbook.write();

			//关闭Excel工作薄对象
			workbook.close();

			//关闭流
			os.flush();
			os.close();

			os = null;
		} catch (Exception e) {
			e.printStackTrace();
		}

    }

	/**
	 * 导出巡更提醒表
	 *
	 * @param response	the response
	 * @param patrolReminderVoList the patrol reminder vo list
	 * @param titleName	the title name
	 * @param sheetName	the sheet name
	 */
	public static void patrolReminderDown(HttpServletResponse response, List<PatrolReminderVo> patrolReminderVoList, String titleName, String sheetName) {

		OutputStream os = null;
		WritableWorkbook workbook = null;

		try {

			os = response.getOutputStream();
			workbook = Workbook.createWorkbook(os);

			WritableSheet sheet = workbook.createSheet(sheetName, 0);

			//创建画笔
			//第一种画笔
			WritableFont wft = new WritableFont(WritableFont.ARIAL, 20, WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK);
			WritableCellFormat wcfmt = new WritableCellFormat(wft);
			wcfmt.setBorder(jxl.format.Border.ALL, jxl.format.BorderLineStyle.THIN);
			//设置水平居中
			wcfmt.setAlignment(Alignment.CENTRE);
			//设置垂直居中
			wcfmt.setVerticalAlignment(VerticalAlignment.CENTRE);
			wcfmt.setWrap(true);

			//第二种画笔
			WritableFont wft1 = new WritableFont(WritableFont.ARIAL, 12, WritableFont.NO_BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK);
			WritableCellFormat wcfmt1 = new WritableCellFormat(wft1);
			wcfmt1.setBorder(jxl.format.Border.ALL, jxl.format.BorderLineStyle.THIN);
			wcfmt1.setAlignment(Alignment.CENTRE);
			//设置垂直居中
			wcfmt1.setVerticalAlignment(VerticalAlignment.CENTRE);
			wcfmt1.setWrap(true);

			//第三种画笔
			WritableFont wft2 = new WritableFont(WritableFont.ARIAL, 12, WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK);
			WritableCellFormat wcfmt2 = new WritableCellFormat(wft2);
			wcfmt2.setBorder(jxl.format.Border.ALL, jxl.format.BorderLineStyle.THIN);
			//设置水平居中
			wcfmt2.setAlignment(Alignment.CENTRE);
			//设置垂直居中
			wcfmt2.setVerticalAlignment(VerticalAlignment.CENTRE);
			wcfmt2.setWrap(true);

			// 第一行
			sheet.mergeCells(0, 0, 10, 0);
			sheet.addCell(new Label(0, 0, titleName, wcfmt));
			sheet.setRowView(0, 1000);

			// ************************ 表头 第二行 ************************//
			// 表头 ==> 序号
			sheet.addCell(new Label(0, 1, "序号", wcfmt2));
			// 表头 ==> 巡更人
			sheet.addCell(new Label(1, 1, "巡更人", wcfmt2));
			// 表头 ==> 巡更位置
			sheet.addCell(new Label(2, 1, "巡更位置", wcfmt2));
			// 表头 ==> 巡更时间
			sheet.addCell(new Label(3, 1, "巡更时间", wcfmt2));
			// 表头 ==> 巡更时间范围
			sheet.addCell(new Label(4, 1, "巡更时间范围", wcfmt2));
			// 表头 ==> 巡更开始时间
			sheet.addCell(new Label(5, 1, "巡更开始时间", wcfmt2));
			// 表头 ==> 巡更结束时间
			sheet.addCell(new Label(6, 1, "巡更结束时间", wcfmt2));
			// 表头 ==> 提醒状态
			sheet.addCell(new Label(7, 1, "提醒状态", wcfmt2));
			// 表头 ==> 实际巡更时间
			sheet.addCell(new Label(8, 1, "实际巡更时间", wcfmt2));
			// 表头 ==> 巡更棒编号
			sheet.addCell(new Label(9, 1, "巡更棒编号", wcfmt2));
			// 表头 ==> 巡更点编号
			sheet.addCell(new Label(10, 1, "巡更点编号", wcfmt2));

			// 设置高度
			sheet.setRowView(2, 450);       // 第二行

			// 设置宽度
			sheet.setColumnView(0, 10);     // 序号
			sheet.setColumnView(1, 25);     // 巡更人
			sheet.setColumnView(2, 30);     // 巡更位置
			sheet.setColumnView(3, 30);     // 巡更时间
			sheet.setColumnView(4, 30);     // 巡更时间范围
			sheet.setColumnView(5, 30);     // 巡更开始时间
			sheet.setColumnView(6, 30);     // 巡更结束时间
			sheet.setColumnView(7, 25);     // 提醒状态
			sheet.setColumnView(8, 25);     // 实际巡更时间
			sheet.setColumnView(9, 25);     // 巡更棒编号
			sheet.setColumnView(10, 25);     // 巡更点编号

			// 体温记录
			int row = 1;
			if (PublicUtil.isNotEmpty(patrolReminderVoList)) {
				for (PatrolReminderVo prv : patrolReminderVoList) {
					// 序号
					sheet.addCell(new Label(0, row + 1, String.valueOf(row), wcfmt2));
					// 巡更人
					sheet.addCell(new Label(1, row + 1, prv.getUserName(), wcfmt1));
					// 巡更位置
					sheet.addCell(new Label(2, row + 1, prv.getLocation(), wcfmt1));
					// 巡更时间
					sheet.addCell(new Label(3, row + 1, prv.getPatrolTime(), wcfmt1));
					// 巡更时间范围
					sheet.addCell(new Label(4, row + 1, prv.getPatrolDuration() + "", wcfmt1));
					// 巡更开始时间
					sheet.addCell(new Label(5, row + 1, prv.getPatrolStart(), wcfmt1));
					// 巡更结束时间
					sheet.addCell(new Label(6, row + 1, prv.getPatrolEnd(), wcfmt1));
					// 提醒状态
					String status = "待巡更";
					if (prv.getStatus().equals(2)) {
						status = "已巡更";
					}
					if (prv.getStatus().equals(3)) {
						status = "已超时";
					}
					sheet.addCell(new Label(7, row + 1, status, wcfmt1));
					// 实际巡更时间
					sheet.addCell(new Label(8, row + 1, prv.getPatrolCheck(), wcfmt1));
					// 巡更棒编号
					sheet.addCell(new Label(9, row + 1, prv.getGreatNo(), wcfmt1));
					// 巡更点编号
					sheet.addCell(new Label(10, row + 1, prv.getPointNo(), wcfmt1));

					// 设置高度
					sheet.setRowView(row, 450);

					// 换下一行
					row++;
				}
			}


			// 写入Excel工作表
			workbook.write();

			//关闭Excel工作薄对象
			workbook.close();

			//关闭流
			os.flush();
			os.close();

			os = null;
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
